Skip to content
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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

TobiasZeuch181
Copy link

  • adding a parameter list
  • if the parameter is set, return the output (as a dictionary)
  • adjusting the documentation for the new parameter
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
  • Feature Pull Request
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


* 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
@ansibullbot

This comment was marked as outdated.

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI feature This issue/PR relates to a feature request module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) labels Aug 19, 2024
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Aug 19, 2024
@felixfontein
Copy link
Collaborator

Thanks for your contribution! Please note that such options are not allowed. Instead you need to add a new _info module, which are for retrieving information (and listing). (See also https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html#scoping-your-module-s.)

@felixfontein
Copy link
Collaborator

@TobiasZeuch181 do you want to continue with this PR (by starting a new module), or should we close it?

@felixfontein
Copy link
Collaborator

needs_info

@ansibullbot ansibullbot added the needs_info This issue requires further information. Please answer any outstanding questions label Aug 26, 2024
@russoz russoz changed the title Adding the list-option for reading the registered list of repositories zypper_repository: add the list-option for reading the registered list of repositories Aug 31, 2024
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Aug 31, 2024
@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label Sep 2, 2024
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
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Sep 2, 2024
@ansibullbot ansibullbot added the tests tests label Sep 3, 2024
I deleted the fragment because this will be created automatically based on the short_description and version_added
@ansibullbot
Copy link
Collaborator

@TobiasZeuch181 this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibullbot ansibullbot added merge_commit This PR contains at least one merge commit. Please resolve! and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels Sep 3, 2024
@TobiasZeuch181
Copy link
Author

Thanks a lot for the reviews and suggestions
I added a test to the zypper_repository test. Is there a way to run this locally?
And I copied the maintainers from the zypper_repository. I guess it would be good to have their buy-in
And is there a way to preview the generated descriptions locally?

@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot removed the needs_info This issue requires further information. Please answer any outstanding questions label Sep 3, 2024
@ansibullbot
Copy link
Collaborator

The test extra-docs failed with 8 errors:

plugins/modules/zypper_repository_info.py:0:0: Did not return correct DOCUMENTATION
plugins/modules/zypper_repository_info.py:0:0: Missing documentation or could not parse documentation: community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/tmp/antsibull-docs-8iq84x49/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/tmp/antsibull-docs-8iq84x49/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
                                                 in "<unicode string>", line 28, column 13:0:0:
                                               could not find expected ':':0:
                                                 in "<unicode string>", line 29, column 9. while scanning a simple key:0:0:
                                                 in "<unicode string>", line 28, column 13:0:0:
                                               could not find expected ':':0:
                                                 in "<unicode string>", line 29, column 9:0:0:

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:9: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:9: unparsable-with-libyaml: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:9: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:9: unparsable-with-libyaml: RETURN: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:9: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:9: unparsable-with-libyaml: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:9: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:9: unparsable-with-libyaml: RETURN: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:97:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9

The test ansible-test sanity --test validate-modules [explain] failed with 6 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.author: Invalid author for dictionary value @ data['author']. Got 'Tobias Zeuch'
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:9: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9

The test ansible-test sanity --test validate-modules [explain] failed with 6 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.author: Invalid author for dictionary value @ data['author']. Got 'Tobias Zeuch'
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:9: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:97:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:97:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9

The test ansible-test sanity --test validate-modules [explain] failed with 6 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.author: Invalid author for dictionary value @ data['author']. Got 'Tobias Zeuch'
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:9: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9

The test ansible-test sanity --test validate-modules [explain] failed with 6 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 9
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.author: Invalid author for dictionary value @ data['author']. Got 'Tobias Zeuch'
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:9: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:97:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

click here for bot help

plugins/modules/zypper_repository_info.py Outdated Show resolved Hide resolved
plugins/modules/zypper_repository_info.py Outdated Show resolved Hide resolved
plugins/modules/zypper_repository_info.py Outdated Show resolved Hide resolved
plugins/modules/zypper_repository_info.py Outdated Show resolved Hide resolved
plugins/modules/zypper_repository_info.py Outdated Show resolved Hide resolved
.github/BOTMETA.yml Outdated Show resolved Hide resolved
plugins/modules/zypper_repository_info.py Outdated Show resolved Hide resolved
@felixfontein
Copy link
Collaborator

I added a test to the zypper_repository test. Is there a way to run this locally?

Something like ansible-test integration --docker opensuse15 -v zypper_repository should work.

And I copied the maintainers from the zypper_repository. I guess it would be good to have their buy-in

Since you are adding $team_suse that should be ok.

And is there a way to preview the generated descriptions locally?

You can use ansible-doc community.general.zypper_repository_info, or use antsibull-docs and Sphinx to build a HTML docsite for community.general (see https://ansible.readthedocs.io/projects/antsibull-docs/collection-docs/).

@russoz
Copy link
Collaborator

russoz commented Sep 5, 2024

I added a test to the zypper_repository test. Is there a way to run this locally?

Something like ansible-test integration --docker opensuse15 -v zypper_repository should work.

And I copied the maintainers from the zypper_repository. I guess it would be good to have their buy-in

Since you are adding $team_suse that should be ok.

And is there a way to preview the generated descriptions locally?

You can use ansible-doc community.general.zypper_repository_info, or use antsibull-docs and Sphinx to build a HTML docsite for community.general (see ansible.readthedocs.io/projects/antsibull-docs/collection-docs).

Hi @TobiasZeuch181

If I may suggest, give it a try to andebox by yours truly:

https://pypi.org/project/andebox/

You can run tests and generate a local docsite easily in your local machine by simply running:

$ andebox test -- sanity --docker default --python 3.10 plugins/modules/your_module.py
$ andebox test -- integration --docker opensuse15 -v zypper_repository
$ andebox docsite -d /tmp/site -o

The documentation is a bit sketchy, but it does the job. Feel free to drop me a message if any help is needed.

@ansibullbot
Copy link
Collaborator

The test botmeta failed with 1 error:

.github/BOTMETA.yml:0:0: Author TobiasZeuch181 not mentioned as active or inactive maintainer for plugins/modules/zypper_repository_info.py (mentioned are: commel, evrardjp, lrupp, toabctl, AnderEnder, alxgu, andytom, sealor, tobiaszeuch181)

The test extra-docs failed with 8 errors:

plugins/modules/zypper_repository_info.py:0:0: Did not return correct DOCUMENTATION
plugins/modules/zypper_repository_info.py:0:0: Missing documentation or could not parse documentation: community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/tmp/antsibull-docs-caa25020/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/tmp/antsibull-docs-caa25020/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
                                                 in "<unicode string>", line 28, column 13:0:0:
                                               could not find expected ':':0:
                                                 in "<unicode string>", line 29, column 5. while scanning a simple key:0:0:
                                                 in "<unicode string>", line 28, column 13:0:0:
                                               could not find expected ':':0:
                                                 in "<unicode string>", line 29, column 5:0:0:

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:5: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:5: unparsable-with-libyaml: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:5: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:5: unparsable-with-libyaml: RETURN: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:5: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:5: unparsable-with-libyaml: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test yamllint [explain] failed with 2 errors:

plugins/modules/zypper_repository_info.py:67:5: error: RETURN: syntax error: could not find expected ':' (syntax)
plugins/modules/zypper_repository_info.py:67:5: unparsable-with-libyaml: RETURN: while scanning a simple key - could not find expected ':'

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:94:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:5: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:5: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:94:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:94:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:5: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Command "ansible-doc -t module community.general.zypper_repository_info" returned exit status 1.
>>> Standard Error
ERROR! module community.general.zypper_repository_info missing documentation (or could not parse documentation): community.general.zypper_repository_info did not contain a DOCUMENTATION attribute (/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py). Unable to parse documentation in python file '/root/ansible_collections/community/general/plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

plugins/modules/zypper_repository_info.py:0:0: attributes-check-mode: The module does not declare support for check mode, but the check_mode attribute's support value is 'full' and not 'none'
plugins/modules/zypper_repository_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: Unable to parse documentation in python file 'plugins/modules/zypper_repository_info.py': while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5. while scanning a simple key
  in "<unicode string>", line 28, column 13
could not find expected ':'
  in "<unicode string>", line 29, column 5
plugins/modules/zypper_repository_info.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.supports_check_mode: not a valid value for dictionary value @ data['supports_check_mode']. Got False
plugins/modules/zypper_repository_info.py:0:0: invalid-documentation: DOCUMENTATION.description.1: Must be a string @ data['description'][1]. Got {'Note': 'for info about packages, use the packages ansible.builtin.package_facts'}
plugins/modules/zypper_repository_info.py:67:5: return-syntax-error: RETURN is not valid YAML

The test ansible-test sanity --test pylint [explain] failed with 1 error:

plugins/modules/zypper_repository_info.py:94:0: unused-import: Unused LooseVersion imported from ansible_collections.community.general.plugins.module_utils.version

click here for bot help

Comment on lines +66 to +68
type:str
sample:
[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type:str
sample:
[
type: str
sample: [

description: The alias of the repository.
type: str
autorefresh:
description: indicates, if autorefresh is enabled on the repository
Copy link
Collaborator

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.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
maintainers: $team_suse tobiaszeuch181
maintainers: $team_suse TobiasZeuch181

@felixfontein felixfontein changed the title zypper_repository: add the list-option for reading the registered list of repositories Add zypper_repository_info module Sep 8, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch labels Sep 8, 2024
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch check-before-release PR will be looked at again shortly before release and merged if possible. feature This issue/PR relates to a feature request has_issue integration tests/integration merge_commit This PR contains at least one merge commit. Please resolve! module module needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a list-option to the zypper_repository module to read the list of registered repositories
4 participants