From 8bdd5240aa224598e89127da910043cfc7e0c59a Mon Sep 17 00:00:00 2001 From: Alexander Gubin Date: Thu, 4 Sep 2014 14:35:39 +0200 Subject: [PATCH] Fix for #8886. Correct state=absent for statements without name/alias. --- packaging/zypper_repository | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/zypper_repository b/packaging/zypper_repository index 26b43a66731..089bd35b4dc 100644 --- a/packaging/zypper_repository +++ b/packaging/zypper_repository @@ -192,11 +192,13 @@ def main(): if name: module.fail_json(msg='Incompatible option: \'name\'. Do not use name when adding repo files') else: - if not name: + if not name and state == "present": module.fail_json(msg='Name required when adding non-repo files:') if repo and repo.endswith('.repo'): exists = repo_exists(module, url=repo, alias=name) + elif repo: + exists = repo_exists(module, url=repo) else: exists = repo_exists(module, alias=name)