-
Notifications
You must be signed in to change notification settings - Fork 64
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
Module generated with changes to ansible.content_builder #416
Conversation
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 13m 06s |
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 13m 03s |
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 13m 48s |
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.
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 |
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.
I would rather prefer the generator to import only required modules
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.
Agree!
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.
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?
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.
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 |
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.
Agree!
@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. |
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 12m 09s |
Build failed. ❌ ansible-test-cloud-integration-vmware-rest FAILURE in 13m 13s |
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
COMPONENT NAME
ADDITIONAL INFORMATION