Commit e3aca2ed authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Allow local CM credential (delegated) to do ListActiveSlivers.

Also add a simple test script.
parent 65cf800c
......@@ -2682,10 +2682,14 @@ sub ListActiveSlivers($)
return GeniResponse->Create(GENIRESPONSE_ERROR);
}
# The target has to match the clearinghouse (delegated credential).
if ($credential->target_urn() ne $certificate->urn()) {
#
# The target has to match the clearinghouse or the local CM.
# Might be (usually is) a delegated credential.
#
if ($credential->target_urn() ne $certificate->urn() &&
$credential->target_urn() ne $authority->urn()) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Only the clearinghouse can do this!");
"Only the CH or local CM can do this!");
}
my $query_result =
DBQueryWarn("select a.idx,m.manifest from geni_aggregates as a ".
......
#! /usr/bin/env python
#
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Work, and to permit persons to whom the Work
# is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Work.
#
# THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS
# IN THE WORK.
#
# }}}
#
#
#
import sys
import pwd
import getopt
import os
import re
import xmlrpclib
from M2Crypto import X509
execfile( "test-common.py" )
if admincredentialfile:
f = open( admincredentialfile )
mycredential = f.read()
f.close()
else:
Fatal("You need to supply an admin credential");
pass
#
# Ask manager for its list.
#
params = {}
params["credentials"] = (mycredential,)
rval,response = do_method("cm", "ListActiveSlivers", params)
if rval:
Fatal("Could not get a list of resources")
pass
print response[ "value" ]
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