Commit f5a8b4a7 authored by Leigh Stoller's avatar Leigh Stoller

Minor change for protogeni. Exclude physical resources that have a

node_attribute with key='protogeni_exclude'. Primitive, but since
there is a web interface and a backend script, its easy for remote
sites to use.
parent a9942747
......@@ -2,7 +2,7 @@
# -*- python -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2003, 2008 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -83,6 +83,9 @@ def main(args):
slice = plab.loadSliceByNode(pid, eid, nodeid)
pass
print str(os.getuid())
print str(os.geteuid())
if command == "alloc":
try:
node = slice.createNode(nodeid, force=parser.values.force)
......
......@@ -373,6 +373,12 @@ if (defined($exempt_eid)) {
"(b.pid='$pid' and b.eid='$exempt_eid'))";
}
# In genimode exclude nodes with exclusion attribute.
if ($genimode) {
$free_condition = "($free_condition and ".
"(nat.attrvalue is null or nat.attrvalue=0))";
}
# If the user wants all nodes, we consider everything to be free (this
# overrides the other possible free conditions
if ($allnodes) {
......@@ -389,6 +395,9 @@ $result =
"left join reserved as m on a.phys_nodeid=m.node_id ".
"left join nodes as np on a.phys_nodeid=np.node_id ".
"left join node_types as t on t.type=a.type ".
"left join node_attributes as nat on ".
" nat.node_id=a.node_id and ".
" nat.attrkey='protogeni_exclude' ".
"left outer join ".
" (select type,attrvalue ".
" from node_type_attributes ".
......
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