From 06aab320842b57f1b19513aabf7fc62f256a9479 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 20 Dec 2023 13:57:20 +0100 Subject: [PATCH] don't fork when the destination project already exists --- obal/data/modules/copr_fork.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obal/data/modules/copr_fork.py b/obal/data/modules/copr_fork.py index 72a8e72d..fdbaf225 100644 --- a/obal/data/modules/copr_fork.py +++ b/obal/data/modules/copr_fork.py @@ -4,7 +4,7 @@ """ from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.copr import copr_cli, CoprCliCommandError, full_name # pylint:disable=import-error,no-name-in-module +from ansible.module_utils.copr import copr_cli, CoprCliCommandError, full_name, project_exists # pylint:disable=import-error,no-name-in-module def main(): @@ -29,6 +29,9 @@ def main(): delete_after_days = module.params['delete_after_days'] config_file = module.params['config_file'] + if project_exists(dest_user, dest_project, module, config_file=config_file): + module.exit_json(changed=False) + command = [ 'fork', full_name(src_user, src_project),