-
Notifications
You must be signed in to change notification settings - Fork 11
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 content_template module #26
Add content_template module #26
Conversation
) | ||
|
||
result = {'failed': False, 'changed': False} | ||
vmware_contentlib_create = VmwareContentCreateTemplate(module) |
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.
what about deleting and updating template?
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.
Added deleting, updating support only notes and name, which is not really needed imho.
6941785
to
c0723a2
Compare
60c54d1
to
43f06f9
Compare
def create_template_from_vm(self): | ||
template = self.get_library_item_from_content_library_name(self.template, self.library) | ||
if template: | ||
self.result['template_info'] = dict( |
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 will be an error? I think we should throw an error if it's update case
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 shouldn't be error. This should return changed=False
and info that the template already exists.
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 this is the same object I agree with you, but what about editing some fields?
we should block 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.
What fields do you mean? Name can be updated, and in future, would be nice to support it.
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 mean if user will apply changes in name or library it will not change nothing but will response that everything is good
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 the user changes something in the placement spec but keeps the name that same, I think this module will give them a confusing result. It will return OK when in reality the template does not have the configuration they expect
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.
As far as I understand the placement is used only for the import process. So after import is done, it really doesn't make sense to change the field. So IMHO it's better to succed, as nothing was really changed then to fail, but makes sense to document it well, so users understand.
def create_template_from_vm(self): | ||
template = self.get_library_item_from_content_library_name(self.template, self.library) | ||
if template: | ||
self.result['template_info'] = dict( |
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 the user changes something in the placement spec but keeps the name that same, I think this module will give them a confusing result. It will return OK when in reality the template does not have the configuration they expect
@machacekondra fix the rebase-conflicts and merge your PR :) |
Module to manage template in content library from virtual machine. Signed-off-by: Ondra Machacek <[email protected]>
43f06f9
to
ae6629f
Compare
Module to create template in content library from virtual machine.