Commit 42febef0 by James Cammarata

Merge pull request #8888 from alxgu/fix_zypp_repo_absent

Fix for #8886. Correct state=absent for statements without name/alias.
parents 8019bc63 7b982949
...@@ -192,11 +192,13 @@ def main(): ...@@ -192,11 +192,13 @@ def main():
if name: if name:
module.fail_json(msg='Incompatible option: \'name\'. Do not use name when adding repo files') module.fail_json(msg='Incompatible option: \'name\'. Do not use name when adding repo files')
else: else:
if not name: if not name and state == "present":
module.fail_json(msg='Name required when adding non-repo files:') module.fail_json(msg='Name required when adding non-repo files:')
if repo and repo.endswith('.repo'): if repo and repo.endswith('.repo'):
exists = repo_exists(module, url=repo, alias=name) exists = repo_exists(module, url=repo, alias=name)
elif repo:
exists = repo_exists(module, url=repo)
else: else:
exists = repo_exists(module, alias=name) exists = repo_exists(module, alias=name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment