Skip to content

Commit

Permalink
Simplify use of check_ansible_presence (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Feb 11, 2022
1 parent ae2ba4c commit 99f88e1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ansiblelint/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from ansiblelint.app import App
from ansiblelint.color import console, console_options, reconfigure, render_yaml
from ansiblelint.config import options
from ansiblelint.constants import ANSIBLE_MISSING_RC, EXIT_CONTROL_C_RC
from ansiblelint.constants import EXIT_CONTROL_C_RC
from ansiblelint.file_utils import abspath, cwd, normpath
from ansiblelint.prerun import check_ansible_presence, prepare_environment
from ansiblelint.skip_utils import normalize_tag
Expand Down Expand Up @@ -81,15 +81,12 @@ def initialize_options(arguments: Optional[List[str]] = None) -> None:
new_options.cwd = pathlib.Path.cwd()

if new_options.version:
ansible_version, err = check_ansible_presence()
ansible_version, _ = check_ansible_presence(exit_on_error=True)
print(
"ansible-lint {ver!s} using ansible {ansible_ver!s}".format(
ver=__version__, ansible_ver=ansible_version
)
)
if err:
_logger.error(err)
sys.exit(ANSIBLE_MISSING_RC)
sys.exit(0)

if new_options.colored is None:
Expand Down

0 comments on commit 99f88e1

Please sign in to comment.