From e1c525f7c8d4640a00d140de7e542baf67b32c8c Mon Sep 17 00:00:00 2001 From: NilashishC Date: Mon, 30 Oct 2023 18:54:31 +0530 Subject: [PATCH] Exit with correct return codes Signed-off-by: NilashishC --- src/ansible_creator/cli.py | 1 + src/ansible_creator/resources/new_collection/galaxy.yml.j2 | 2 +- src/ansible_creator/subcommands/init.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ansible_creator/cli.py b/src/ansible_creator/cli.py index 259ec373..cdb90724 100644 --- a/src/ansible_creator/cli.py +++ b/src/ansible_creator/cli.py @@ -178,6 +178,7 @@ def run(self: Cli) -> None: subcommand(config=Config(**args), output=self.output).run() except CreatorError as exc: self.output.error(str(exc)) + sys.exit(1) self.output.debug(msg="exiting ansible-creator") diff --git a/src/ansible_creator/resources/new_collection/galaxy.yml.j2 b/src/ansible_creator/resources/new_collection/galaxy.yml.j2 index d55f15c5..e7626fd1 100644 --- a/src/ansible_creator/resources/new_collection/galaxy.yml.j2 +++ b/src/ansible_creator/resources/new_collection/galaxy.yml.j2 @@ -1,4 +1,4 @@ -# This collection is initialized by https://github.com/ansible-community/ansible_creator {{ creator_version }} +# This collection is initialized by https://github.com/ansible-community/ansible-creator {{ creator_version }} # See https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html diff --git a/src/ansible_creator/subcommands/init.py b/src/ansible_creator/subcommands/init.py index 97f98f63..d6c03997 100644 --- a/src/ansible_creator/subcommands/init.py +++ b/src/ansible_creator/subcommands/init.py @@ -27,7 +27,8 @@ def __init__( ) -> None: """Initialize the init action. - :param kwargs: Arguments passed for the init action + :param config: App configuration object. + :param output: Output class object. """ self._namespace: str = config.namespace self._collection_name: str = config.collection_name