Commit 280947af authored by Jonathon Duerig's avatar Jonathon Duerig

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents d3bfaf4a c9fdb1f0
......@@ -1588,6 +1588,7 @@ STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0
EXP_VIS_SUPPORT=0
NOSTACKMIB=0
SELFLOADER_DATA="__DATA__"
#
# XXX You really don't want to change these!
......@@ -1952,6 +1953,16 @@ cat >> confdefs.h <<EOF
EOF
#
# Perl SelfLoader
# XXX this is a hack which enables us to disable it on versions of perl
# where there are problems with taint checking in the SelfLoader module.
#
cat >> confdefs.h <<EOF
#define SELFLOADER_DATA "$SELFLOADER_DATA"
EOF
#
# LEDA library path
#
......@@ -2135,7 +2146,6 @@ else
event/linktest/GNUmakefile \
event/linktest/iperf/GNUmakefile \
event/linktest/rude/GNUmakefile \
event/linktest/linktest.pl \
event/linktest/weblinktest event/linktest/linktest.proxy \
event/linktest/linktest_control \
event/linktest/run_linktest.pl";
......@@ -3094,6 +3104,7 @@ s%@GMAP_API_KEY@%$GMAP_API_KEY%g
s%@NODE_USAGE_SUPPORT@%$NODE_USAGE_SUPPORT%g
s%@NOSTACKMIB@%$NOSTACKMIB%g
s%@EXP_VIS_SUPPORT@%$EXP_VIS_SUPPORT%g
s%@SELFLOADER_DATA@%$SELFLOADER_DATA%g
s%@TBOPSEMAIL@%$TBOPSEMAIL%g
s%@TBOPSEMAIL_NOSLASH@%$TBOPSEMAIL_NOSLASH%g
s%@TBROBOCOPSEMAIL@%$TBROBOCOPSEMAIL%g
......
......@@ -219,6 +219,7 @@ AC_SUBST(GMAP_API_KEY)
AC_SUBST(NODE_USAGE_SUPPORT)
AC_SUBST(NOSTACKMIB)
AC_SUBST(EXP_VIS_SUPPORT)
AC_SUBST(SELFLOADER_DATA)
#
# Offer both versions of the email addresses that have the @ escaped
......@@ -307,6 +308,7 @@ STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0
EXP_VIS_SUPPORT=0
NOSTACKMIB=0
SELFLOADER_DATA="__DATA__"
#
# XXX You really don't want to change these!
......@@ -546,6 +548,13 @@ if test -z "$EVENTSERVER"; then
fi
AC_DEFINE_UNQUOTED(EVENTSERVER, "$EVENTSERVER")
#
# Perl SelfLoader
# XXX this is a hack which enables us to disable it on versions of perl
# where there are problems with taint checking in the SelfLoader module.
#
AC_DEFINE_UNQUOTED(SELFLOADER_DATA, "$SELFLOADER_DATA")
#
# LEDA library path
#
......@@ -692,7 +701,6 @@ else
event/linktest/GNUmakefile \
event/linktest/iperf/GNUmakefile \
event/linktest/rude/GNUmakefile \
event/linktest/linktest.pl \
event/linktest/weblinktest event/linktest/linktest.proxy \
event/linktest/linktest_control \
event/linktest/run_linktest.pl";
......
......@@ -172,9 +172,8 @@ $TBOPSPID = "emulab-ops";
$EXPTLOGNAME = "activity.log";
$PROJROOT = "@PROJROOT_DIR@";
# _Always_ make sure that this 1 is at the end of the file...
1;
__DATA__
@SELFLOADER_DATA@
#
# Needs to be configured.
......@@ -649,4 +648,5 @@ sub TBMinTrust($$)
return $trust_value >= $minimum;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -338,7 +338,7 @@ sub Stringify($)
}
1;
__DATA__
@SELFLOADER_DATA@
sub dbrow($$) { return $_[0]->{'EXPT'}; }
sub locked($) { return $_[0]->expt_locked(); }
......@@ -4507,5 +4507,3 @@ sub ReserveSharedBandwidth($;$$)
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -1036,6 +1036,7 @@ sub IsProjectGroup($)
sub GetProject($)
{
my ($self) = @_;
require Project;
# Must be a real reference.
return undef
......
......@@ -175,9 +175,8 @@ sub LocalExpLookup(@)
return Experiment->Lookup(@_);
}
# _Always_ make sure that this 1 is at the end of the file...
1;
__DATA__
@SELFLOADER_DATA@
#
# Create a fake object, as for the mapper (assign_wrapper) during debugging.
......@@ -2640,5 +2639,6 @@ sub IsOSLoaded($$)
return $query_result->numrows;
}
1;
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -58,9 +58,8 @@ sub _checklossrate($)
return 1;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
__DATA__
@SELFLOADER_DATA@
# Constants for checkslot code.
sub TBDB_CHECKDBSLOT_NOFLAGS() { 0x0; }
......@@ -462,4 +461,5 @@ sub ParRun($$$@)
return 0;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -101,9 +101,8 @@ sub TBdbfork()
sub hash_recurse2($%);
sub array_recurse2($%);
# _Always_ make sure that this 1 is at the end of the file...
1;
__DATA__
@SELFLOADER_DATA@
# Local lookup for a Node, to avoid dragging in the module.
sub LocalNodeLookup($)
......@@ -2632,5 +2631,6 @@ sub TBSetNodeHistory($$$$$)
}
return $node->SetNodeHistory($op, $this_user, $experiment);
}
1;
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -25,6 +25,7 @@ use GeniCredential;
use Compress::Zlib;
use MIME::Base64;
use XML::LibXML;
# Disable UUID checks in GeniCredential.
$GeniCredential::CHECK_UUID = 0;
......@@ -237,6 +238,34 @@ sub DeleteSliver()
}
}
# No prototype because it is recursive and as such, the prototype
# causes a warning.
#
# Return a hash containing a JSONish representation of the given node.
sub XmlToJson
{
my ($node) = @_;
my $attrs = {};
foreach my $attr ($node->attributes) {
$attrs->{$attr->nodeName()} = $attr->nodeValue();
}
my $children = [];
foreach my $child ($node->childNodes) {
if ($child->nodeType() == XML_ELEMENT_NODE) {
push(@$children, XmlToJson($child));
}
}
my $result = {
"name" => $node->nodeName(),
"attributes" => $attrs,
"children" => $children
};
return $result;
}
# Get the status of the sliver associated with the given slice. This
# just passes on to the CM SliverStatus operation.
sub SliverStatus()
......@@ -255,9 +284,7 @@ sub SliverStatus()
my $pgstatus = GeniResponse::value($response);
my $status = {};
# How do we determine the sliver URN? Is there one for the whole
# sliver, or just for each individual sliver?
$status->{'geni_urn'} = 'Unknown';
$status->{'geni_urn'} = $slice_urn;
# Determine geni_status. XXX how to determine 'configuring'?
if ($pgstatus->{'status'} eq 'ready') {
......@@ -268,15 +295,44 @@ sub SliverStatus()
$status->{'geni_status'} = 'unknown';
}
# include the pg status
$status->{'pg_status'} = $pgstatus->{'status'};
# include the expiration
my $slice = GeniSlice->Lookup($slice_urn);
$status->{'pg_expires'} = $slice->expires();
my $details = $pgstatus->{'details'};
my @children = ();
while ( my ($pgurn, $pgrstat) = each(%$details) ) {
# Look up the sliver so we can extract info from the manifest.
my $sliver = GeniSliver->Lookup($pgurn);
my $child = {
'geni_urn' => $pgurn,
# XXX Need to massage status to one of the AM status values
'geni_status' => $pgrstat->{'status'},
'geni_error' => $pgrstat->{'error'},
'pg_status' => $pgrstat->{'status'},
};
# Put manifest info in...
my $manifest = $sliver->GetManifest(0);
if (0) {
# An example of how to include a single element from the
# manifest. Abondoned this approach and went to XmlToJson
# instead. Finds the "login", then the "hostname" inside
# the rspec
my $login = GeniXML::FindNodes(".//n:services//n:login", $manifest);
if (defined($login)) {
my $login = @$login[0];
my $host = GeniXML::GetText("hostname", $login);
if (defined($host)) {
$child->{'pg_hostname'} = $host;
}
}
}
$child->{'pg_manifest'} = XmlToJson($manifest);
#$child->{'pg_xml_manifest'} = GeniXML::Serialize($manifest);
push @children, $child;
}
$status->{'geni_resources'} = \@children;
......
......@@ -535,7 +535,7 @@ if (isset($types['garcia']) ||
($expstate == $TB_EXPTSTATE_ACTIVE ?
"?pid=$exp_pid&eid=$exp_eid" : ""));
if ($expstate == $TB_EXPTSTATE_SWAPPED) {
if ($types['static-mica2']) {
if (isset($types['static-mica2']) && $types['static-mica2']) {
WRITESUBMENUBUTTON("Selector Applet",
"robotrack/selector.php3?".
"pid=$exp_pid&eid=$exp_eid");
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007 University of Utah and the Flux Group.
# Copyright (c) 2007, 2010 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
......@@ -53,7 +53,7 @@ if (!preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $IP) ||
$query_result =
DBQueryFatal("select IP from widearea_nodeinfo where privkey='$privkey'");
if (! mysql_num_rows($query_result)) {
SPITSTATUS(WASTATUS_PRIVKEY);
SPITSTATUS(WASTATUS_BADPRIVKEY);
return;
}
......
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