-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zypper_repository_info module #8778
base: main
Are you sure you want to change the base?
Add zypper_repository_info module #8778
Conversation
* adding a parameter list * if the parameter is set, return the output (as a dictionary) * adjusting the documentation for the new parameter
and link to the issue in the issue-tracker ansible-collections#8777
This comment was marked as outdated.
This comment was marked as outdated.
Thanks for your contribution! Please note that such options are not allowed. Instead you need to add a new |
@TobiasZeuch181 do you want to continue with this PR (by starting a new module), or should we close it? |
needs_info |
I created a new module for reading the repositories based on a sub-procedure from the existing zypper_repository
because the list-option is not supposed to go into this module
This comment was marked as outdated.
This comment was marked as outdated.
Something like
Since you are adding
You can use |
If I may suggest, give it a try to https://pypi.org/project/andebox/ You can run tests and generate a local docsite easily in your local machine by simply running:
The documentation is a bit sketchy, but it does the job. Feel free to drop me a message if any help is needed. |
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
|
type:str | ||
sample: | ||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type:str | |
sample: | |
[ | |
type: str | |
sample: [ |
description: The alias of the repository. | ||
type: str | ||
autorefresh: | ||
description: indicates, if autorefresh is enabled on the repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some more descriptions to adjust. I didn't add comments for all of them.
description: indicates, if autorefresh is enabled on the repository | |
description: Indicates, if autorefresh is enabled on the repository. |
description: the priority of the repository | ||
type: int | ||
url: | ||
description: the url of the repository on the internet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: the url of the repository on the internet | |
description: The URL of the repository on the internet. |
@@ -1434,6 +1434,9 @@ files: | |||
ignore: matze | |||
labels: zypper | |||
maintainers: $team_suse | |||
$modules/zypper_repository_info.py: | |||
labels: zypper | |||
maintainers: $team_suse tobiaszeuch181 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maintainers: $team_suse tobiaszeuch181 | |
maintainers: $team_suse TobiasZeuch181 |
cc806b1
to
ce5134e
Compare
@TobiasZeuch181 This PR was evaluated as a potentially problematic PR for the following reasons:
Such PR can only be merged by human. Contact a Core team member to review this PR on IRC: |
…h the last rebase
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
7f947cf
to
74f9bec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @TobiasZeuch181 Thanks for the contribution.
There's a couple of comments that should be tended to.
Cheers
import traceback | ||
|
||
XML_IMP_ERR = None | ||
try: | ||
from xml.dom.minidom import parseString as parseXML | ||
HAS_XML = True | ||
except ImportError: | ||
XML_IMP_ERR = traceback.format_exc() | ||
HAS_XML = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to consider using module_utils.deps
, see https://docs.ansible.com/ansible/latest/collections/community/general/docsite/guide_deps.html for guidance on how to use it.
--- | ||
module: zypper_repository_info | ||
author: "Tobias Zeuch (@TobiasZeuch181)" | ||
version_added: 9.4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version_added: 9.4.0 | |
version_added: 9.5.0 |
SUMMARY
A new list-option for the zypper_repository community-module that returns the list of registered repositories with the attributes as returned by zypper repos
Fixes #8777
ISSUE TYPE
COMPONENT NAME
zypper_repository
ADDITIONAL INFORMATION
the code was already there to retrieve the data and it is already converted into a json list of dictionaries. All that was missing was the option to return the data and the documentation