* zypper_repository: handle repositories without <url/> element
zypper_repository identifies repos using a combination of "alias"
and "url". Recently, openSUE has begun using "metalink" attributes
instead of "url" elements, causing errors like this:
File "/tmp/ansible_zypper_repository_payload_euim_nod/ansible_zypper_repository_payload.zip/ansible_collections/community/general/plugins/modules/zypper_repository.py", line 475, in <module>
File "/tmp/ansible_zypper_repository_payload_euim_nod/ansible_zypper_repository_payload.zip/ansible_collections/community/general/plugins/modules/zypper_repository.py", line 448, in main
File "/tmp/ansible_zypper_repository_payload_euim_nod/ansible_zypper_repository_payload.zip/ansible_collections/community/general/plugins/modules/zypper_repository.py", line 223, in repo_exists
File "/tmp/ansible_zypper_repository_payload_euim_nod/ansible_zypper_repository_payload.zip/ansible_collections/community/general/plugins/modules/zypper_repository.py", line 177, in _parse_repos
IndexError: list index out of range
Fix this by using the "metalink" attribute instead of the value
of the "url" element if the latter is missing.
* Update changelogs/fragments/10224-zypper_repository-metalink.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
* zypper_repository: fix usage of removed method ConfigParser.readfp()
ConfigParser.readfp() has been removed in python 3.12.
See similar fix e.g. in https://github.com/ansible/ansible/pull/81657
This fixes the error message:
AttributeError: 'ConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?
* Update changelogs/fragments/10222-zypper_repository-readfp.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>