Commit 8bcea0b2 authored by Leigh B Stoller's avatar Leigh B Stoller

Minor bug fixes.

parent 85d092cb
...@@ -153,11 +153,13 @@ if ($isshared) { ...@@ -153,11 +153,13 @@ if ($isshared) {
# #
# Create the type if it does not exist. # Create the type if it does not exist.
# #
if (!defined(NodeType->Lookup($type))) { my $nodetype = NodeType->Lookup($type);
if (!defined($nodetype)) {
CreateType($type, 0); CreateType($type, 0);
if ($isshared) { if ($isshared) {
CreateType("${type}-vm", 1); CreateType("${type}-vm", 1);
} }
$nodetype = NodeType->Lookup($type);
} }
CreateNode(); CreateNode();
exit(0); exit(0);
...@@ -182,8 +184,8 @@ sub CreateType($$) ...@@ -182,8 +184,8 @@ sub CreateType($$)
" class='$type', type='$type', ". " class='$type', type='$type', ".
" isvirtnode='$isvirt', isdynamic='$isvirt'"); " isvirtnode='$isvirt', isdynamic='$isvirt'");
if ($isshared && $isvirt) { if (0 && $isshared && $isvirt) {
DBQueryFatal("insert into node_auxtypes values ". DBQueryFatal("replace into node_auxtypes values ".
"('$node_id', '$type', '$isshared')"); "('$node_id', '$type', '$isshared')");
} }
} }
...@@ -223,7 +225,8 @@ sub CreateNode() ...@@ -223,7 +225,8 @@ sub CreateNode()
{ {
my $blob = { my $blob = {
"type" => $type, "type" => $type,
"role" => "testnode", "role" => ($nodetype->isswitch() ?
"testswitch" : "testnode"),
"initial_eventstate" => TBDB_NODESTATE_ISUP(), "initial_eventstate" => TBDB_NODESTATE_ISUP(),
}; };
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