Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
df4ff178
Commit
df4ff178
authored
Apr 15, 2011
by
David Johnson
Browse files
Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel
parents
c320c151
e3ca221a
Changes
4
Hide whitespace changes
Inline
Side-by-side
protogeni/scripts/update.in
View file @
df4ff178
...
...
@@ -110,6 +110,7 @@ if ($?) {
exit
(
0
);
}
require
GeniDB
;
import
GeniDB
;
require
GeniCertificate
;
OneShot
()
...
...
tbsetup/snmpit_cisco.pm
View file @
df4ff178
...
...
@@ -1049,7 +1049,9 @@ sub opPortVlan($$$@) {
# Make sure the port didn't get mangled in conversion
#
if
(
!
defined
$index
)
{
print
STDERR
"
Port not found, skipping
\n
";
my
$name
=
$self
->
{
NAME
};
print
STDERR
"
Port (
$port
) not found on
$name
, skipping
\n
";
$errors
++
;
next
;
}
...
...
tbsetup/snmpit_new.in
View file @
df4ff178
...
...
@@ -1662,6 +1662,10 @@ sub doVlansFromTables($$@) {
}
my
(
$stack
)
=
@$stacks
;
# $debug = 1;
# $stack->FlipDebug(1);
my
@trunkedPorts
=
getExperimentTrunks
(
$experiment
->
pid
(),
$experiment
->
eid
());
my
%trunkedPorts
=
map
{
$_
=>
$_
}
@trunkedPorts
;
...
...
@@ -1901,11 +1905,15 @@ sub doReset($@) {
# In case of error, do not clear the DB state.
my
%notdeleted
=
();
$debug
=
1
;
#
# Just remove the VLAN from every stack on which it exists. We keep a
# list and do them all at once for efficiency.
#
foreach
my
$stack
(
@$stacks
)
{
# $stack->FlipDebug(1);
my
@existant_vlans
=
$stack
->
existantVlans
(
@vlans
);
if
(
!
$stack
->
removeVlan
(
@existant_vlans
))
{
#
...
...
@@ -1944,13 +1952,15 @@ sub syncVlansFromTables($$) {
my
$errors
=
0
;
my
$vlan_number
;
$debug
=
1
;
if
(
@$stacks
>
1
)
{
die
"
VLAN creation across multiple stacks is not yet supported
\n
"
.
"
Stacks are
"
.
join
("
,
",
map
{
$_
->
{
STACKID
}}
@$stacks
)
.
"
\n
";
}
my
(
$stack
)
=
@$stacks
;
$debug
=
1
;
$stack
->
FlipDebug
(
1
);
my
@needTrunking
=
getExperimentTrunks
(
$pid
,
$eid
);
my
%needTrunking
=
map
{
$_
=>
$_
}
@needTrunking
;
...
...
tbsetup/snmpit_stack.pm
View file @
df4ff178
...
...
@@ -15,6 +15,7 @@ $| = 1; # Turn off line buffering on output
use
English
;
use
SNMP
;
use
snmpit_lib
;
use
Data::
Dumper
;
use
libdb
;
use
libtestbed
;
...
...
@@ -165,6 +166,25 @@ sub Stringify($)
return
"
[Stack
${stack_id}
]
";
}
sub
FlipDebug
($$)
{
my
$self
=
shift
;
my
$debug
=
shift
;
$self
->
{'
DEBUG
'}
=
$debug
;
$
snmpit_stack_child::
child_debug
=
$debug
;
foreach
my
$devicename
(
keys
%
{
$self
->
{
DEVICES
}})
{
my
$device
=
$self
->
{
DEVICES
}{
$devicename
};
$device
->
{'
DEBUG
'}
=
$debug
;
}
foreach
my
$device
(
values
(
%devices
))
{
$device
->
{'
DEBUG
'}
=
$debug
;
# print Dumper($device);
}
return
0
;
}
#
# List all VLANs on all switches in the stack
#
...
...
@@ -846,6 +866,7 @@ sub removeSomePortsFromVlan($$@) {
warn
"
ERROR: VLAN
$vlan_id
not found on switch!
";
return
0
;
}
my
%map
=
mapPortsToDevices
(
@ports
);
#
# Now, we go through each device and remove all ports from the VLAN
...
...
@@ -855,7 +876,7 @@ sub removeSomePortsFromVlan($$@) {
# first, so the other snmpit will not see it free until it's been
# removed from all switches)
#
foreach
my
$devicename
(
sort
{
tbsort
(
$b
,
$a
)}
keys
%
{
$self
->
{
DEVICES
}}
)
{
foreach
my
$devicename
(
sort
{
tbsort
(
$b
,
$a
)}
keys
%
map
)
{
my
$device
=
$self
->
{
DEVICES
}{
$devicename
};
my
%vlan_numbers
=
$device
->
findVlans
(
$vlan_id
);
...
...
@@ -870,9 +891,9 @@ sub removeSomePortsFromVlan($$@) {
print
"
Removing ports on
$devicename
from VLAN
$vlan_id
(
$vlan_number
)
\n
"
if
$self
->
{
DEBUG
};
$errors
+=
$device
->
removeSomePortsFromVlan
(
$vlan_number
,
@ports
);
$errors
+=
$device
->
removeSomePortsFromVlan
(
$vlan_number
,
@
{
$map
{
$devicename
}});
}
return
(
$errors
==
0
);
}
...
...
@@ -899,6 +920,7 @@ sub removeSomePortsFromTrunk($$@) {
warn
"
ERROR: VLAN
$vlan_id
not found on switch!
";
return
0
;
}
my
%map
=
mapPortsToDevices
(
@ports
);
#
# Now, we go through each device and remove all ports from the trunk
...
...
@@ -908,7 +930,7 @@ sub removeSomePortsFromTrunk($$@) {
# first, so the other snmpit will not see it free until it's been
# removed from all switches)
#
foreach
my
$devicename
(
sort
{
tbsort
(
$b
,
$a
)}
keys
%
{
$self
->
{
DEVICES
}}
)
{
foreach
my
$devicename
(
sort
{
tbsort
(
$b
,
$a
)}
keys
%
map
)
{
my
$device
=
$self
->
{
DEVICES
}{
$devicename
};
my
%vlan_numbers
=
$device
->
findVlans
(
$vlan_id
);
...
...
@@ -920,10 +942,11 @@ sub removeSomePortsFromTrunk($$@) {
my
$vlan_number
=
$vlan_numbers
{
$vlan_id
};
print
"
Removing ports on
$devicename
from VLAN
$vlan_id
(
$vlan_number
)
\n
"
print
"
Removing trunk ports on
$devicename
from VLAN
"
.
"
$vlan_id
(
$vlan_number
)
\n
"
if
$self
->
{
DEBUG
};
foreach
my
$port
(
@
ports
)
{
foreach
my
$port
(
@
{
$map
{
$devicename
}}
)
{
return
0
if
(
!
$device
->
setVlansOnTrunk
(
$port
,
0
,
$vlan_number
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment