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

Module generated with changes to ansible.content_builder #416

Closed

Conversation

GomathiselviS
Copy link
Contributor

SUMMARY

The vmware header template in Content Builder tool is updated with imports and pylint skips. This PR has the changes made to vmware_rest modules generated by the updated Content Builder tool.

ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
  • Feature Pull Request
  • New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/613ff31eca9f48a187bd50a55b570321

ansible-test-cloud-integration-vmware-rest FAILURE in 13m 06s
✔️ build-ansible-collection SUCCESS in 9m 17s
ansible-tox-linters FAILURE in 10m 42s
ansible-test-sanity-docker-devel FAILURE in 13m 14s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 10m 50s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 10m 53s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 12m 21s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 12m 40s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 7m 48s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 42s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 10m 25s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 9m 38s
✔️ ansible-galaxy-importer SUCCESS in 3m 26s

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/51bf6afa249840e38bc31a0c33ffeea5

ansible-test-cloud-integration-vmware-rest FAILURE in 13m 03s
✔️ build-ansible-collection SUCCESS in 9m 36s
ansible-tox-linters FAILURE in 10m 54s
ansible-test-sanity-docker-devel FAILURE in 11m 00s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 10m 40s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 13m 55s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 12m 06s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 11m 59s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 03s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 00s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 11m 22s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 10m 00s
✔️ ansible-galaxy-importer SUCCESS in 3m 36s

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/a25ba1f616da46efab460c3ec98f21e0

ansible-test-cloud-integration-vmware-rest FAILURE in 13m 48s
✔️ build-ansible-collection SUCCESS in 9m 44s
ansible-tox-linters FAILURE in 11m 06s
ansible-test-sanity-docker-devel FAILURE in 9m 27s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 11m 21s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 14m 41s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 11m 44s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 14m 39s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 10s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 12m 25s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 11m 22s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 10m 08s
✔️ ansible-galaxy-importer SUCCESS in 3m 50s

Copy link
Collaborator

@abikouo abikouo left a comment

Choose a reason for hiding this comment

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

Is it easy to update the content builder to import only required modules?

@@ -102,8 +103,8 @@
"set": {"query": {}, "body": {"enabled": "enabled"}, "path": {}}
} # pylint: disable=line-too-long

import json
import socket
import json # pylint: disable=unused-import
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would rather prefer the generator to import only required modules

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree!

Copy link
Contributor Author

@GomathiselviS GomathiselviS May 2, 2023

Choose a reason for hiding this comment

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

We have a single header template file, which is rendered into all the module files. Some module files use the imported libraries and some do not. The usage is not common across all module files. You can see the pylint errors here. From what I see the errors due to unused imports are not the same for all module files. It is better to import all libraries in the template file and skip pylint test for the libraries, that are seen in the pylint errors. What are your thoughts?

Copy link
Collaborator

@alinabuzachis alinabuzachis left a comment

Choose a reason for hiding this comment

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

Examples generation does not work with the ansible.content_builder and we should not alter/delete the existing examples unless there's an update. We should also not update version_added. As Aubin suggested, I would import the libraries where necessary instead of skipping the lint.

@@ -102,8 +103,8 @@
"set": {"query": {}, "body": {"enabled": "enabled"}, "path": {}}
} # pylint: disable=line-too-long

import json
import socket
import json # pylint: disable=unused-import
Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree!

plugins/modules/appliance_monitoring_info.py Outdated Show resolved Hide resolved
plugins/modules/content_locallibrary.py Show resolved Hide resolved
plugins/modules/vcenter_vm_hardware_cdrom_info.py Outdated Show resolved Hide resolved
plugins/modules/vcenter_vm_hardware_cpu.py Outdated Show resolved Hide resolved
plugins/modules/vcenter_vm_hardware_cpu.py Outdated Show resolved Hide resolved
plugins/modules/vcenter_vm_hardware_cpu_info.py Outdated Show resolved Hide resolved
plugins/modules/vcenter_vm_hardware_disk.py Outdated Show resolved Hide resolved
plugins/modules/vcenter_vm_hardware_disk_info.py Outdated Show resolved Hide resolved
@GomathiselviS
Copy link
Contributor Author

Examples generation does not work with the ansible.content_builder and we should not alter/delete the existing examples unless there's an update. We should also not update version_added. As Aubin suggested, I would import the libraries where necessary instead of skipping the lint.

@alinabuzachis As I have explained in the reply to @abikouo's comment, I see that these imported libraries are not common across all module files. As we use a single template file for all the module files, it is better to mention all the libraries in the template file, which will be rendered as multiple files. Let me know your thoughts.

I have fixed the examples, return block and version_added fields.

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/e152a2f83a564a21ab4b67589f6818c0

ansible-test-cloud-integration-vmware-rest FAILURE in 12m 09s
✔️ build-ansible-collection SUCCESS in 9m 37s
ansible-tox-linters FAILURE in 10m 56s
ansible-test-sanity-docker-devel FAILURE in 9m 09s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 8m 39s (non-voting)
ansible-test-sanity-docker-stable-2.9 FAILURE in 12m 43s
ansible-test-sanity-docker-stable-2.10 FAILURE in 11m 34s (non-voting)
ansible-test-sanity-docker-stable-2.11 FAILURE in 14m 18s
ansible-test-sanity-docker-stable-2.12 FAILURE in 9m 44s
ansible-test-sanity-docker-stable-2.13 FAILURE in 8m 46s
ansible-test-sanity-docker-stable-2.14 FAILURE in 8m 38s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 10m 53s
ansible-galaxy-importer FAILURE in 4m 11s

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/c23e10cf5f2441cda3d9169b0e76ffc0

ansible-test-cloud-integration-vmware-rest FAILURE in 13m 13s
✔️ build-ansible-collection SUCCESS in 9m 22s
ansible-tox-linters FAILURE in 10m 43s
ansible-test-sanity-docker-devel FAILURE in 9m 50s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 9m 28s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 14m 25s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 12m 37s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 12m 09s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 9m 21s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 12m 19s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 9m 18s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 9m 39s
✔️ ansible-galaxy-importer SUCCESS in 4m 17s

@GomathiselviS GomathiselviS requested a review from gravesm May 3, 2023 18:30
@mariolenz
Copy link
Collaborator

I've fixed the sanity tests in #432 by removing the unused imports with autoflake. Therefor I think this PR is unnecessary now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants