Commit f2a9dae6 authored by Leigh B Stoller's avatar Leigh B Stoller

Do not create a control network interface entries for the proxy

node; this causes an ambiguity when the proxy is for a local
cluster node (which happens cause all protogeni nodes are considered
remote nodes. The control network IP *does* go into the
widearea_nodeinfo table.
parent 6b407cd1
...@@ -255,10 +255,6 @@ sub CreatePhysNode($) ...@@ -255,10 +255,6 @@ sub CreatePhysNode($)
print STDERR "Invalid hrn '$hrn' in blob from CM for $node_urn\n"; print STDERR "Invalid hrn '$hrn' in blob from CM for $node_urn\n";
goto bad; goto bad;
} }
if (! ($IP =~ /^[-\w\.]*$/)) {
print STDERR "Invalid IP '$IP' in blob from CM for $node_urn\n";
goto bad;
}
if (! ($uuid =~ /^[-\w\.]*$/)) { if (! ($uuid =~ /^[-\w\.]*$/)) {
print STDERR "Invalid uuid '$uuid' in blob from CM for $node_urn\n"; print STDERR "Invalid uuid '$uuid' in blob from CM for $node_urn\n";
goto bad; goto bad;
...@@ -281,8 +277,21 @@ sub CreatePhysNode($) ...@@ -281,8 +277,21 @@ sub CreatePhysNode($)
# #
if (exists($blob->{'interfaces'})) { if (exists($blob->{'interfaces'})) {
foreach my $ref (@{ $blob->{'interfaces'} }) { foreach my $ref (@{ $blob->{'interfaces'} }) {
if ($ref->{'role'} eq TBDB_IFACEROLE_CONTROL() || my $role = $ref->{'role'};
$ref->{'role'} eq TBDB_IFACEROLE_EXPERIMENT()) {
if ($role eq "ctrl" || $role eq "control") {
$IP = $ref->{'IP'};
#
# This turns out to be a problem; if the node is actually
# on the local cluster (we treat all protogeni nodes same),
# we end up with two nodes in the interfaces table with the
# same IP; not allowed since stuff breaks (bootinfo, tmcd).
#
next;
}
if ($role eq TBDB_IFACEROLE_CONTROL() ||
$role eq TBDB_IFACEROLE_EXPERIMENT()) {
my $MAC = $ref->{'MAC'}; my $MAC = $ref->{'MAC'};
if (!defined($MAC) || !($MAC =~ /^[:\w]*$/)) { if (!defined($MAC) || !($MAC =~ /^[:\w]*$/)) {
print STDERR "Bad mac in blob for $node_urn:\n"; print STDERR "Bad mac in blob for $node_urn:\n";
...@@ -337,6 +346,17 @@ sub CreatePhysNode($) ...@@ -337,6 +346,17 @@ sub CreatePhysNode($)
} }
elsif ($role eq "ctrl" || $role eq "control") { elsif ($role eq "ctrl" || $role eq "control") {
$role = TBDB_IFACEROLE_CONTROL(); $role = TBDB_IFACEROLE_CONTROL();
my $ipv4 = GeniXML::GetText("public_ipv4", $ref);
$IP = $ipv4;
#
# This turns out to be a problem; if the node is actually
# on the local cluster (we treat all protogeni nodes same),
# we end up with two nodes in the interfaces table with the
# same IP; not allowed since stuff breaks (bootinfo, tmcd).
#
next;
} }
else { else {
print STDERR "Unknown role $role for $node_urn!\n"; print STDERR "Unknown role $role for $node_urn!\n";
...@@ -370,10 +390,14 @@ sub CreatePhysNode($) ...@@ -370,10 +390,14 @@ sub CreatePhysNode($)
print STDERR "No interfaces in blob for $node_urn!\n"; print STDERR "No interfaces in blob for $node_urn!\n";
goto bad; goto bad;
} }
if (!defined($ctrliface)) { if (!defined($IP)) {
print STDERR "No control interface in blob for $node_urn!\n"; print STDERR "No control interface in blob for $node_urn!\n";
goto bad; goto bad;
} }
if (! ($IP =~ /^[-\w\.]*$/)) {
print STDERR "Invalid IP '$IP' in blob from CM for $node_urn\n";
goto bad;
}
my $newnode = Node->Create($node_id, undef, my $newnode = Node->Create($node_id, undef,
{"role" => "testnode", {"role" => "testnode",
"type" => "pcfedphys", "type" => "pcfedphys",
......
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