Commit 779f4ca6 authored by Robert Ricci's avatar Robert Ricci
Browse files

A couple minor bugfixes.

parent b9ef7da1
......@@ -434,8 +434,7 @@ sub vlanNumberExists($$) {
# or not
#
my $rv = $self->{SESS}->get([$VlanName,"1.$vlan_number"]);
if (!$rv) {
print "rv was $rv\n";
if (!$rv or $rv eq "NOSUCHINSTANCE") {
return 0;
} else {
return 1;
......@@ -568,7 +567,7 @@ sub createVlan($$;$$$) {
my $VlanRowStatus = 'vtpVlanEditRowStatus'; # vlan # is index
#
# If they gave a VLAN number, make sure it exists
# If they gave a VLAN number, make sure it doesn't exist
#
if ($vlan_number) {
if ($self->vlanNumberExists($vlan_number)) {
......
......@@ -278,7 +278,7 @@ sub createVlan($$$;$$$) {
# What we do here depends on whether this stack uses VTP to synchronize
# VLANs or not
#
my $okay;
my $okay = 1;
if ($self->{VTP}) {
#
# We just need to create the VLAN on the stack leader
......@@ -293,8 +293,9 @@ sub createVlan($$$;$$$) {
#
my $vlan_number = undef;
foreach my $devicename (sort {tbsort($a,$b)} keys %{$self->{DEVICES}}) {
print "Creating VLAN on switch $devicename ... \n" if $self->{DEBUG};
my $device = $self->{DEVICES}{$devicename};
my $res = $self->{LEADER}->createVlan($vlan_id,undef,@otherargs);
my $res = $device->createVlan($vlan_id,$vlan_number,@otherargs);
if (!$res) {
#
# Ooops, failed. Don't try any more
......
Supports Markdown
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