]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fixed an issue selecting the right port interface and also properly switching off...
authorEdgar Magana <eperdomo@cisco.com>
Wed, 3 Aug 2011 20:29:43 +0000 (13:29 -0700)
committerEdgar Magana <eperdomo@cisco.com>
Wed, 3 Aug 2011 20:29:43 +0000 (13:29 -0700)
quantum/plugins/cisco/nexus/cisco_nexus_network_driver.py
quantum/plugins/cisco/nexus/cisco_nexus_plugin.py

index 2e95409d35d883644f2063ff718c0672127e32ed..27e63ce4cb5ecef6d448250d64300bf50c08ad32 100644 (file)
@@ -193,6 +193,12 @@ class CiscoNEXUSDriver():
         print confstr
         mgr.edit_config(target='running', config=confstr)
 
+    def disable_switch_port(self, mgr, interface):
+        confstr = cmd_no_switchport % (interface)
+        confstr = exec_conf_prefix + confstr + exec_conf_postfix
+        print confstr
+        mgr.edit_config(target='running', config=confstr)
+
     def enable_vlan_on_trunk_int(self, mgr, interface, vlanid):
         confstr = cmd_vlan_int_snippet % (interface, vlanid)
         confstr = exec_conf_prefix + confstr + exec_conf_postfix
@@ -221,12 +227,14 @@ class CiscoNEXUSDriver():
         with self.nxos_connect(nexus_host, 22, nexus_user,
                                nexus_password) as m:
             self.enable_vlan(m, vlan_id, vlan_name)
-            self.enable_port_trunk(m, nexus_interface)
+            self.enable_vlan_on_trunk_int(m, nexus_interface, vlan_id)
 
-    def delete_vlan(self, vlan_id, nexus_host, nexus_user, nexus_password):
+    def delete_vlan(self, vlan_id, nexus_host, nexus_user,
+                    nexus_password, nexus_interface):
         with self.nxos_connect(nexus_host, 22, nexus_user,
                                nexus_password) as m:
             self.disable_vlan(m, vlan_id)
+            self.disable_switch_port(m, nexus_interface)
 
 
 def main():
index 349a69ca5504282c2a2b2df4a4c174783fc3013f..31baac47297e0bc29919d5d45631c096ce1b3321 100644 (file)
@@ -79,7 +79,7 @@ class NexusPlugin(object):
         vlan_id = self._get_vlan_id_for_network(tenant_id, net_id)
         if net:
             self._client.delete_vlan(str(vlan_id), self._nexus_ip,
-                self._nexus_username, self._nexus_password)
+                self._nexus_username, self._nexus_password, self._nexus_port)
             self._networks.pop(net_id)
             return net
         # Network not found