Commit 5f421c8e authored by Leigh B Stoller's avatar Leigh B Stoller

Minor changes to make sure we get "role" correct (nodes table).

parent 636cea07
...@@ -223,9 +223,33 @@ sub CreateType($) ...@@ -223,9 +223,33 @@ sub CreateType($)
# #
sub CreateSwitch() sub CreateSwitch()
{ {
my $role = "testswitch";
if ($usersw) {
$role = "testnode";
}
elsif ($layer1) {
# XXX Huh?
$role = "widearea_switch";
}
elsif (defined($stack)) {
if ($stack eq "Control") {
$role = "ctrlswitch";
}
elsif ($stack eq "Experiment") {
$role = "testswitch";
}
else {
fatal("Do not know how to handle stack $stack wrt role");
}
}
else {
print STDERR "No -S argument, defaulting to role=$role\n";
}
my $blob = { my $blob = {
"type" => $type, "type" => $type,
"role" => ($layer1 ? "widearea_switch" : "testswitch"), "role" => $role,
"initial_eventstate" => TBDB_NODESTATE_ISUP(), "initial_eventstate" => TBDB_NODESTATE_ISUP(),
}; };
...@@ -233,8 +257,7 @@ sub CreateSwitch() ...@@ -233,8 +257,7 @@ sub CreateSwitch()
# User switches needs some different stuff. # User switches needs some different stuff.
# #
if ($usersw) { if ($usersw) {
$blob->{"role"} = "testnode"; $blob->{"initial_eventstate"} = TBDB_NODESTATE_ALWAYSUP();
$blob->{"initial_eventstate"} = TBDB_NODESTATE_SHUTDOWN();
} }
my $node; my $node;
......
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