From 44eaf79647a8c457cd9ca5b7417fb5c014cda28d Mon Sep 17 00:00:00 2001 From: Shih-Hao Li Date: Thu, 22 Sep 2016 11:43:21 -0700 Subject: [PATCH] NSXv3: Fix problem when reset lport attachment When the attachment is reset on a neutron port (for example, a VM is deleted on a pre-created neutron port), the attachment type/id will be reset on the corresponding logical port. But currently the plugin doesn't do it because it skips passing the attachment attribute if it is None. Change-Id: Iacccf6dce1780c0cb6bc8332e065482d699e5cb9 --- vmware_nsx/nsxlib/v3/resources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/nsxlib/v3/resources.py b/vmware_nsx/nsxlib/v3/resources.py index ace377e32f..a19b569633 100644 --- a/vmware_nsx/nsxlib/v3/resources.py +++ b/vmware_nsx/nsxlib/v3/resources.py @@ -240,8 +240,8 @@ class LogicalPort(AbstractRESTResource): }) body['switching_profile_ids'] = profiles - if attachment: - body['attachment'] = attachment + # Note that attachment could be None, meaning reset it. + body['attachment'] = attachment return body