VMware: Change in update tag API (#54304)

Changed update tag API as per new changes.

Fixes: #53060

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2019-03-25 21:50:46 +05:30 committed by GitHub
parent 6d978bc285
commit 5db7501ebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- Updated VMware Update tag API as new specifications (https://github.com/ansible/ansible/issues/53060).

View file

@ -185,13 +185,15 @@ class VmwareTag(VmwareRestClient):
"""
changed = False
tag_id = self.global_tags[self.tag_name]['tag_id']
results = dict(msg="Tag %s is unchanged." % self.tag_name,
tag_id=self.global_tags[self.tag_name]['tag_id'])
tag_id=tag_id)
tag_update_spec = self.tag_service.UpdateSpec()
tag_desc = self.global_tags[self.tag_name]['tag_description']
desired_tag_desc = self.params.get('tag_description')
if tag_desc != desired_tag_desc:
tag_update_spec.setDescription = desired_tag_desc
tag_update_spec.description = desired_tag_desc
self.tag_service.update(tag_id, tag_update_spec)
results['msg'] = 'Tag %s updated.' % self.tag_name
changed = True