Commit ba1a72bb authored by Mike Hibler's avatar Mike Hibler

Merge remote branch 'central/master'

parents 9214ef9e 70574e71
......@@ -11,7 +11,7 @@ use Exporter;
use vars qw(@ISA @EXPORT);
@ISA = "Exporter";
@EXPORT = qw(Parse ParseFile FindNodes FindFirst FindElement FindAttr IsLanNode IsLocalNode GetNodeId GetVirtualId GetManagerId SetText GetText CreateDocument AddElement);
@EXPORT = qw(Parse ParseFile FindNodes FindNodesNS FindFirst FindElement FindAttr IsLanNode IsLocalNode GetNodeId GetVirtualId GetManagerId SetText GetText CreateDocument AddElement);
use English;
use XML::LibXML;
......@@ -88,6 +88,33 @@ sub FindNodes($$)
}
}
# Returns a NodeList for a given XPath using a given namespace as
# context. 'n' is defined to be the prefix for the given namespace.
sub FindNodesNS($$$)
{
my ($path, $node, $nsURI) = @_;
my $result = undef;
eval {
my $xc = XML::LibXML::XPathContext->new();
if (defined($nsURI)) {
$xc->registerNs('n', $nsURI);
} else {
$path =~ s/\bn://g;
}
$result = $xc->findnodes($path, $node);
};
if ($@) {
if (! defined($nsURI)) {
$nsURI = "undefined";
}
cluck "Failed to find nodes using XPath path='$path', nsURI='$nsURI': $@\n";
return XML::LibXML::NodeList->new();
} else {
return $result;
}
}
# Returns the first Node which matches a given XPath against a given
# node. If that node is not of the specified type, returns
# undefined. Works like FindNodes.
......
......@@ -77,6 +77,8 @@ INSERT INTO sitevariables VALUES ('general/joinproject/admincheck','1','0','When
INSERT INTO sitevariables VALUES ('protogeni/allow_externalusers','1','1','When set, external users may allocate slivers on your testbed.',0);
INSERT INTO sitevariables VALUES ('protogeni/max_externalnodes',NULL,'1024','When set, external users may allocate slivers on your testbed.',0);
INSERT INTO sitevariables VALUES ('protogeni/cm_uuid','28a10955-aa00-11dd-ad1f-001143e453fe','','The UUID of the local Component Manager.',0);
INSERT INTO sitevariables VALUES ('protogeni/max_ticket_lifetime','90','90','The maximum ticket lifetime. When set limits the lifetime of a ticket.',0);
INSERT INTO sitevariables VALUES ('protogeni/max_components','-1','-1','Maximum number of components that can be allocated. -1 indicates any number of components can be allocated.',0);
INSERT INTO sitevariables VALUES ('general/minpoolsize','3','1','The Minimum size of the shared pool',0);
INSERT INTO sitevariables VALUES ('general/maxpoolsize','5','1','The maximum size of the shared pool',0);
INSERT INTO sitevariables VALUES ('protogeni/sa_uuid','2b437faa-aa00-11dd-ad1f-001143e453fe','','The UUID of the local Slice Authority.',0);
......
#!/usr/bin/perl -wT
#
# 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.
#
use English;
......@@ -132,10 +132,10 @@ process_nodes($db_result);
# Get the list of currently-reserved nodes so that we can make CNAMEs for them
#
$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;
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 -
......@@ -144,8 +144,15 @@ while (my ($node_id,$pid,$eid,$vname) = $db_result->fetchrow_array()) {
if (!defined($vname)) {
$vname = $node_id;
}
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