Commit 0d342aa2 authored by Leigh B Stoller's avatar Leigh B Stoller

Watch for errors from RecordVlan Insertion/Modification.

parent a1ab09d1
...@@ -1722,14 +1722,20 @@ sub doRestorePortStatus($@) { ...@@ -1722,14 +1722,20 @@ sub doRestorePortStatus($@) {
print "Could not yank $port from $source_vlan\n"; print "Could not yank $port from $source_vlan\n";
$errors++; $errors++;
} }
VLan->RecordVlanInsertion($source_vlan->id(), $stack->{STACKID}); if (VLan->RecordVlanInsertion($source_vlan->id(), $stack->{STACKID})){
print "Could not record vlan insertion for $source_vlan\n";
$errors++;
}
} }
if (defined($target_vlan) && $target_vlan->KeepInSync()) { if (defined($target_vlan) && $target_vlan->KeepInSync()) {
if ($target_vlan->AddPort($port)) { if ($target_vlan->AddPort($port)) {
print "Could not add $port to $target_vlan\n"; print "Could not add $port to $target_vlan\n";
$errors++; $errors++;
} }
VLan->RecordVlanInsertion($target_vlan->id(), $stack->{STACKID}); if (VLan->RecordVlanInsertion($target_vlan->id(), $stack->{STACKID})){
print "Could not record vlan insertion for $target_vlan\n";
$errors++;
}
} }
# Enable or disable the port # Enable or disable the port
...@@ -2068,7 +2074,10 @@ sub CreateOneVlan($$$@) ...@@ -2068,7 +2074,10 @@ sub CreateOneVlan($$$@)
# Record an insertion to make sure the DB reflects the current state # Record an insertion to make sure the DB reflects the current state
# of the vlan. # of the vlan.
# #
VLan->RecordVlanInsertion($vlanid, $stack->{STACKID}); if (VLan->RecordVlanInsertion($vlanid, $stack->{STACKID})) {
print STDERR "Could not record vlan insertion for $vlanid\n";
$errors++;
}
# #
# Set the speed and duplex of each interface depending on the # Set the speed and duplex of each interface depending on the
...@@ -3122,7 +3131,10 @@ sub doSyncVlansWithDB($) { ...@@ -3122,7 +3131,10 @@ sub doSyncVlansWithDB($) {
$errors++; $errors++;
} }
} }
VLan->RecordVlanInsertion($vlan->id(), $stackid); if (VLan->RecordVlanInsertion($vlan->id(), $stackid)) {
print "Could not record vlan insertion for $vlan\n";
$errors++;
}
} }
} }
} }
...@@ -3396,7 +3408,10 @@ sub doMakeVlan($$@) { ...@@ -3396,7 +3408,10 @@ sub doMakeVlan($$@) {
# since we need to compute the path each time we sync it (-X). # since we need to compute the path each time we sync it (-X).
setSwitchTrunkPath($source_vlan) setSwitchTrunkPath($source_vlan)
if (! $source_vlan->IsShared()); if (! $source_vlan->IsShared());
VLan->RecordVlanInsertion($source_vlan, $stack->{STACKID}); if (VLan->RecordVlanInsertion($source_vlan, $stack->{STACKID})) {
print "Could not record vlan insertion for $source_vlan\n";
$errors++;
}
} }
if (defined($target_vlan) && $target_vlan->KeepInSync()) { if (defined($target_vlan) && $target_vlan->KeepInSync()) {
# Have to do this cause we cleared it above # Have to do this cause we cleared it above
...@@ -3410,7 +3425,10 @@ sub doMakeVlan($$@) { ...@@ -3410,7 +3425,10 @@ sub doMakeVlan($$@) {
# since we need to compute the path each time we sync it (-X). # since we need to compute the path each time we sync it (-X).
setSwitchTrunkPath($target_vlan) setSwitchTrunkPath($target_vlan)
if (! $target_vlan->IsShared()); if (! $target_vlan->IsShared());
VLan->RecordVlanInsertion($target_vlan, $stack->{STACKID}); if (VLan->RecordVlanInsertion($target_vlan, $stack->{STACKID})) {
print "Could not record vlan insertion for $target_vlan\n";
$errors++;
}
} }
} }
return $errors; return $errors;
......
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