Commit 70574e71 authored by Leigh B Stoller's avatar Leigh B Stoller

Add a "www" CNAME for inner boss nodes.

parent f87e07a3
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group. # Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use English; use English;
...@@ -132,10 +132,10 @@ process_nodes($db_result); ...@@ -132,10 +132,10 @@ process_nodes($db_result);
# Get the list of currently-reserved nodes so that we can make CNAMEs for them # Get the list of currently-reserved nodes so that we can make CNAMEs for them
# #
$db_result = $db_result =
DBQueryFatal("select node_id,pid,eid,vname from reserved"); DBQueryFatal("select node_id,pid,eid,vname,inner_elab_role from reserved");
my %cnames; my %cnames;
while (my ($node_id,$pid,$eid,$vname) = $db_result->fetchrow_array()) { while (my ($node_id,$pid,$eid,$vname,$erole) = $db_result->fetchrow_array()) {
# #
# Handle some rare cases where a node can get reserved without a vname - # Handle some rare cases where a node can get reserved without a vname -
...@@ -144,8 +144,15 @@ while (my ($node_id,$pid,$eid,$vname) = $db_result->fetchrow_array()) { ...@@ -144,8 +144,15 @@ while (my ($node_id,$pid,$eid,$vname) = $db_result->fetchrow_array()) {
if (!defined($vname)) { if (!defined($vname)) {
$vname = $node_id; $vname = $node_id;
} }
push @{$cnames{$node_id}}, "$vname.$eid.$pid"; push @{$cnames{$node_id}}, "$vname.$eid.$pid";
#
# Special case for inner elab boss; add CNAME for www.
#
if (defined($erole) &&
($erole eq "boss" || $erole eq "boss+router")) {
push @{$cnames{$node_id}}, "www.$eid.$pid";
}
} }
......
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