Skip to content

Commit

Permalink
don't fork when the destination project already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Dec 20, 2023
1 parent 728b8f3 commit 06aab32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion obal/data/modules/copr_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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),
Expand Down

0 comments on commit 06aab32

Please sign in to comment.