Commit 89ab38d9 authored by Weibin Sun's avatar Weibin Sun Committed by Robert Ricci

enable,disable ports when add,delete ports done, test passed.

parent 510a7adc
......@@ -267,7 +267,7 @@ sub portInst2Sysdb($$) {
my ($self, $port) = @_;
if (int($port->card()) == 1000) { # This is a port-channel.
$pcid = $port->port();
my $pcid = $port->port();
return "Port-Channel$pcid";
} else {
return "Ethernet".$port->card()."/".$port->port();
......@@ -683,7 +683,7 @@ sub setPortVlan($$@) {
# if the vlan is '1', then disable ports(which means deleting the ports from
# some vlan).
my $onoroff = ($vlan_number ne "1")? "enable":"disable";
$error += $self->portControl($onoroff, @ports);
$errors += $self->portControl($onoroff, @ports);
return $errors;
}
......
......@@ -63,16 +63,16 @@ def vlanExists(sysdb, vlan_num):
return bc.vlanConfig.has_key(vlan_num)
def setPortAdminStatus(sysdb, port, enabld=1):
def setPortAdminStatus(sysdb, port, enabled=1):
pc = sysdb['interface']['config']['all'].get(port)
if pc is None:
debug("setPortAdminStatus("+str(port)+","+str(enabled)+") error: can not get port.")
return
if enabled==1:
pc.adminEnabled='True'
pc.adminEnabled=True
else:
pc.adminEnabled='False'
pc.adminEnabled=False
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment