Merging changes.

This commit is contained in:
Sumit Naiksatam 2011-08-03 15:38:21 -07:00
commit e1c068a999
2 changed files with 11 additions and 3 deletions

View 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():

View 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