Commit graph

9 commits

Author SHA1 Message Date
Robin Roth
e8fdba7593 Zypper repository rewrite (#1990)
* Remove support for ancient zypper versions

Even SLES11 has zypper 1.x.

* zypper_repository: don't silently ignore repo changes

So far when a repo URL changes this got silently ignored (leading to
incorrect package installations) due to this code:

    elif 'already exists. Please use another alias' in stderr:
        changed = False

Removing this reveals that we correctly detect that a repo definition
has changes (via repo_subset) but don't indicate this as change but as a
nonexistent repo. This makes us currenlty bail out silently in the above
statement.

To fix this distinguish between non existent and modified repos and
remove the repo first in case of modifications (since there is no force
option in zypper to overwrite it and 'zypper mr' uses different
arguments).

To do this we have to identify a repo by name, alias or url.

* Don't fail on empty values

This unbreaks deleting repositories

* refactor zypper_repository module

* add properties enabled and priority
* allow changing of one property and correctly report changed
* allow overwrite of multiple repositories by alias and URL
* cleanup of unused code and more structuring

* respect enabled option

* make zypper_repository conform to python2.4

* allow repo deletion only by alias

* check for non-existant url field and use alias instead

* remove empty notes and aliases

* add version_added for priority and overwrite_multiple

* add version requirement on zypper and distribution

* zypper 1.0 is enough and exists

* make suse versions note, not requirement

based on comment by @alxgu
2016-04-18 17:47:17 +02:00
Thomas Bechtold
04496b70ae zypper_repository: Fix repo parsing for empty list
When no repositories are defined in zypper, the return code
of "zypper repos" is 6. Handle that case and don't fail
if zypper_repository has to deal with an empty repo list.

Fixes https://github.com/ansible/ansible-modules-extras/issues/795
2015-08-01 21:27:01 +02:00
Greg DeKoenigsberg
004dedba8a Changes to author formatting, remove emails 2015-06-16 14:32:39 -04:00
Brian Coca
08445418aa more string corrections 2015-05-14 10:45:32 -04:00
Greg DeKoenigsberg
16ce411f66 Adding author's github id 2015-05-14 00:39:40 -04:00
Toshio Kuratomi
16d622aab8 Fix documentation in zypper_repository 2015-01-14 20:49:44 -08:00
Justin Lecher
8658b6783a
Keep default behaviour for refresh
Signed-off-by: Justin Lecher <jlec@gentoo.org>
2015-01-14 15:50:18 +01:00
Justin Lecher
7248c0861d
Allow disabling of autorefresh for zypper repositories
In case of release repositories or other special cases you might not
need the autorefreshing of the repos. This patch adds a configure
option instead of hard enabling this.

Signed-off-by: Justin Lecher <jlec@gentoo.org>
2015-01-09 16:07:42 +01:00
Michael DeHaan
7e6fc7023d Reorganization. 2014-11-04 17:31:59 -05:00
Renamed from packaging/zypper_repository.py (Browse further)