-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Added folder and datacenter to the examples #25221
Conversation
From #22644 it seems that the parameter 'folder' is mandatory. While both are required parameters they should be used in the examples.
@@ -60,6 +60,7 @@ | |||
folder: | |||
description: | |||
- Define instance folder location. | |||
required: True |
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 doesn't look correct
folder=dict(required=False, type='str', default='/vm'),
I think it should actually be
default: /vm
on this line
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 not a documentation issue, module should be changed to either require folder or implement an actual search.
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 agree that the issue with the folder parameter may not be a documentation issue in the first place. I'm also not sure if it makes much sense to define a default value for an optional parameter. Maybe that discussion should stay in #22644.
I suggest to remove line 63 again, but leave the examples as they are. Showing the option in the examples don't hurt. Would you agree on that?
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.
optional parameters should always have a default, the module does not need to use it though.
A saner default would have been 'null/None' in which case the module should ignore it.
I reverted the documentation of the folder option to be a not required one. This way it stays consistent with the definition of the function.
So I reverted the change to the folder documentation to be a non required option again. This way the documentation is consistent to the code, where it is defined as not required as well: This way the discussion about how to change this option could take place outside of this PR. The parameter 'datacenter' should be used in the examples, because it is a mandatory one. This way the examples are consistent with the parameter definition at the beginning of the module documentation. The 'folder' parameter should be used in the examples as well. It doesn't hurt, whether it is required or not. And in the current version you have to use it or your vm won't be found. |
This PR would fix #24203. |
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.
shipit
shipit |
* Added folder and datacenter to the examples From ansible#22644 it seems that the parameter 'folder' is mandatory. While both are required parameters they should be used in the examples. * Removed 'required: True' from folder documentation I reverted the documentation of the folder option to be a not required one. This way it stays consistent with the definition of the function.
SUMMARY
From #22644 it seems that the parameter 'folder' is mandatory. While both are required parameters they should be used in the examples.
ISSUE TYPE
COMPONENT NAME
vmware_guest_snapshot
ANSIBLE VERSION