From 5db7501ebdacf65a8cf076da35ed6c3011c4c58a Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 25 Mar 2019 21:50:46 +0530 Subject: [PATCH] VMware: Change in update tag API (#54304) Changed update tag API as per new changes. Fixes: #53060 Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/53060-vmware_tag-update_desc.yml | 2 ++ lib/ansible/modules/cloud/vmware/vmware_tag.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/53060-vmware_tag-update_desc.yml diff --git a/changelogs/fragments/53060-vmware_tag-update_desc.yml b/changelogs/fragments/53060-vmware_tag-update_desc.yml new file mode 100644 index 00000000000..7aba1e62dbb --- /dev/null +++ b/changelogs/fragments/53060-vmware_tag-update_desc.yml @@ -0,0 +1,2 @@ +minor_changes: +- Updated VMware Update tag API as new specifications (https://github.com/ansible/ansible/issues/53060). diff --git a/lib/ansible/modules/cloud/vmware/vmware_tag.py b/lib/ansible/modules/cloud/vmware/vmware_tag.py index 9a3f17741da..1617b3ecadc 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_tag.py +++ b/lib/ansible/modules/cloud/vmware/vmware_tag.py @@ -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