-
Notifications
You must be signed in to change notification settings - Fork 10
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
consolidate argument specs and doc fragments #89
base: main
Are you sure you want to change the base?
consolidate argument specs and doc fragments #89
Conversation
9d32d91
to
6a60822
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
+ Coverage 27.48% 28.03% +0.54%
==========================================
Files 24 25 +1
Lines 2059 2076 +17
Branches 385 385
==========================================
+ Hits 566 582 +16
- Misses 1493 1494 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
proxy_protocol: | ||
description: | ||
- The proxy connection protocol to use. | ||
- This is option is used if the correct proxy protocol cannot be automatically determined. |
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.
- This is option is used if the correct proxy protocol cannot be automatically determined. | |
- This option is used if the correct proxy protocol cannot be automatically determined. |
# This vmware.vmware.base_options fragment covers the arg spec provided by the base_argument_spec() function | ||
DOCUMENTATION = r''' | ||
notes: | ||
- All modules require API write access and hence is not supported on a free ESXi license. |
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.
- All modules require API write access and hence is not supported on a free ESXi license. | |
- All modules require API write access and hence are not supported on a free ESXi license. |
default: 443 | ||
proxy_host: | ||
description: | ||
- Address of a proxy that will receive all HTTPS requests and relay them. |
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.
- Address of a proxy that will receive all HTTPS requests and relay them. | |
- The address of a proxy that will receive all HTTPS requests and relay them. |
required: false | ||
proxy_port: | ||
description: | ||
- Port of the HTTP proxy that will receive all HTTPS requests and relay them. |
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.
- Port of the HTTP proxy that will receive all HTTPS requests and relay them. | |
- The port of the HTTP proxy that will receive all HTTPS requests and relay them. |
""" | ||
This returns a dictionary that can be used as the baseline for all REST module specs. | ||
If your module uses the REST API, you should use this instead of the base_argument_spec. | ||
If your module uses both this and the pyvmomi SDK, you should still use this spec. |
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.
If your module uses both this and the pyvmomi SDK, you should still use this spec. | |
If your module uses both this spec and the pyvmomi SDK, you should still use this spec. |
|
||
def base_argument_spec(): | ||
""" | ||
This returns a dictionary that can be used as the baseline for all vmware module specs. Any arguments |
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.
This returns a dictionary that can be used as the baseline for all vmware module specs. Any arguments | |
This returns a dictionary that can be used as the baseline for all VMware module specs. Any arguments |
SUMMARY
Combining #86 and #87
This removes instances of repeated option documentation and redundant spec args.
ISSUE TYPE
COMPONENT NAME
doc fragments
argument specs
ADDITIONAL INFORMATION
While I was working on this, I found the kubernetes collection has a pretty nice pattern for breaking out the doc fragments. I tried to copy theirs, https://github.com/ansible-collections/kubernetes.core/tree/main/plugins/doc_fragments
Similar pattern for the arg specs too https://github.com/ansible-collections/kubernetes.core/blob/main/plugins/module_utils/args_common.py