From 1b036cf984d7ba0d28d7485f58a547028ddab753 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Fri, 12 May 2017 05:33:29 -0700 Subject: [PATCH] NSX|V: fix missing spoofguard ID validation Do not throw and exception when the policy does not exist on the NSX. Change-Id: Ia3944281099e907954797cdbf15ed2d6fc9def42 --- .../shell/admin/plugins/nsxv/resources/spoofguard_policy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py index 10b6fc07ec..bd24d54a43 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/spoofguard_policy.py @@ -118,7 +118,7 @@ def nsx_clean_spoofguard_policy(resource, event, trigger, **kwargs): LOG.error("Unable to retrieve policy %(p)s: %(e)s", {'p': policy_id, 'e': str(e)}) else: - if not c['spoofguardList']: + if not c.get('spoofguardList'): LOG.error("Policy %s does not exist", policy_id) return confirm = admin_utils.query_yes_no(