From 34616b5ba1bebf2cfd968438a55b4a0d4d74ef5f Mon Sep 17 00:00:00 2001 From: Roey Chen Date: Thu, 30 Jun 2016 05:41:25 -0700 Subject: [PATCH] NSX-V: Re-raise exception if failed to assign security-group to port We want to stop port-update request if it fails to add the vnic to one of the security-groups at the backend. Change-Id: I3bcd47c27cc19c444d45ab15a591efd7fbf7b1ce Closes-Bug: #1633729 --- vmware_nsx/plugins/nsx_v/plugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 8fdf9f5ee8..3743a53663 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -512,10 +512,11 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, "group %(vnic_id)s"), {'sg_id': sg_id, 'vnic_id': vnic_id}) except Exception: - LOG.debug("NSX security group %(sg_id)s member add " - "failed %(vnic_id)s.", - {'sg_id': sg_id, - 'vnic_id': vnic_id}) + with excutils.save_and_reraise_exception(): + LOG.error(_LE("NSX security group %(sg_id)s member add " + "failed %(vnic_id)s."), + {'sg_id': sg_id, + 'vnic_id': vnic_id}) def _add_security_groups_port_mapping(self, session, vnic_id, added_sgids):