From cb1b42a93eed84c9a28a3ee0db8a51b661a430ec Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Fri, 22 May 2020 18:33:12 +0530 Subject: [PATCH] vmware_vm_inventory: Replace guest.guestId with config.guestId guest.guestId is optional value and may not be populated everytime. Use config.guestId instead which is mandatory. Removed 'tag' property from properties since this property is never populated. Partially fixes https://github.com/ansible/awx/issues/7052 Signed-off-by: Abhijeet Kasurde --- awx/main/models/inventory.py | 5 ++--- .../inventory/plugins/vmware/files/vmware_vm_inventory.yml | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index e80e8dd565..a3f05b1401 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -2275,7 +2275,7 @@ class vmware(PluginFileInjector): "customValue", # optional "datastore", "effectiveRole", - "guestHeartbeatStatus", # optonal + "guestHeartbeatStatus", # optional "layout", # optional "layoutEx", # optional "name", @@ -2287,7 +2287,6 @@ class vmware(PluginFileInjector): "resourcePool", "rootSnapshot", "snapshot", # optional - "tag", "triggeredAlarmState", "value" ] @@ -2356,7 +2355,7 @@ class vmware(PluginFileInjector): }) else: # default groups from script - for entry in ('guest.guestId', '"templates" if config.template else "guests"'): + for entry in ('config.guestId', '"templates" if config.template else "guests"'): ret['keyed_groups'].append({ 'prefix': '', 'separator': '', 'key': entry diff --git a/awx/main/tests/data/inventory/plugins/vmware/files/vmware_vm_inventory.yml b/awx/main/tests/data/inventory/plugins/vmware/files/vmware_vm_inventory.yml index d08a5ff126..ac1db9f4cf 100644 --- a/awx/main/tests/data/inventory/plugins/vmware/files/vmware_vm_inventory.yml +++ b/awx/main/tests/data/inventory/plugins/vmware/files/vmware_vm_inventory.yml @@ -43,7 +43,6 @@ properties: - resourcePool - rootSnapshot - snapshot -- tag - triggeredAlarmState - value - capability