1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/library
Hector Acosta d3268d05ec Correctly handle .repo files in zypper_repository module
Before the changes, removing a repository required a repo url. This shouldn't be required since zypper allows removing a repo based on its alias (mapped to name in this module).

The name variable was always required, which is misleading since repofiles provide their own alias. So a runtime check was added to avoid this confusion.

Additionaly, running this module on .repo files weren't idempotent. e.g

Before:
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo name=foo"
{"repo": "http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo", "state": "present", "changed": true}
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo name=foo"
{"msg": "Repository named 'devel_languages_python' already exists. Please use another alias.\n", "failed": true}

After:
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo"
{"repo": "http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo", "state": "present", "changed": true}
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo"
{"repo": "http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo", "state": "present", "changed": false}

Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
2014-06-26 13:17:27 -07:00
..
cloud Merge pull request #7925 from devpopol/fixes/api_error 2014-06-25 22:33:22 -05:00
commands Added examples to the command module 2014-06-24 13:47:23 +02:00
database Merge pull request #6766 from Jmainguy/mysql_db_bug 2014-06-23 12:42:42 -05:00
files Merge branch 'fix_lineinfile_newlines' into devel 2014-06-23 12:38:12 -05:00
internal Make async jid's unique per host 2014-03-26 13:48:47 -05:00
inventory Make add_host clear the inventory pattern cache, add some more aliases. Fixes #4442. 2013-10-11 16:37:10 -04:00
messaging Fix version_added for node in rabbitmq modules 2014-04-08 10:40:41 -04:00
monitoring Stackdriver module was in the wrong category, so moving. 2014-05-16 08:30:38 -04:00
net_infrastructure Added author and copyright lines to modules I contributed 2014-06-19 20:02:02 -04:00
network unified calls to fs function vs duplicate functions for file and 2014-05-24 09:28:45 -04:00
notification Stackdriver module was in the wrong category, so moving. 2014-05-16 08:30:38 -04:00
packaging Correctly handle .repo files in zypper_repository module 2014-06-26 13:17:27 -07:00
source_control Merge branch 'git_fix' of https://github.com/pkit/ansible into pkit-git_fix 2014-06-20 12:47:21 -05:00
system Updating the other classes in the group module to match #7249 2014-06-24 12:28:43 -05:00
utilities Merge pull request #7374 from hfinucane/wait_for_pipes 2014-06-20 15:55:10 -05:00
web_infrastructure Updates django_manage so it populates VIRTUAL_ENV 2014-06-17 12:01:14 -04:00
windows Merge pull request #7889 from chrishoffman/win_group 2014-06-22 11:26:27 -05:00