def ParseJobsTable(self) :
print "ParseJobsTable"
- def ParseJobsDetails (self):
-
+ def ParseJobsDetails (self):
+ # currently, this function is not used a lot, so i have no idea what be usefull to parse, returning the full json. NT
print >>sys.stderr,"ParseJobsDetails %s " %(self.raw_json)
+ return self.raw_json
def ParseJobsIds(self):
#node_tags = self.get_node_tags(tags_filter)
#links = self.get_links(sites_dict, nodes_dict, interfaces)
-
+ reserved_nodes=self.driver.GetReservedNodes()
rspec_nodes = []
for node in nodes:
# skip whitelisted nodes
# do not include boot state (<available> element) in the manifest rspec
if not slice:
rspec_node['boot_state'] = node['boot_state']
+ if node['hostname'] in reserved_nodes:
+ rspec_node['boot_state'] = "Reserved"
rspec_node['exclusive'] = 'True'
rspec_node['hardware_types'] = [HardwareType({'name': 'slab-node'})]
+
# only doing this because protogeni rspec needs
# to advertise available initscripts
#rspec_node['pl_initscripts'] = None
#'api_timestamp']
#assigned_res = ['resource_id', 'resource_uri']
#assigned_n = ['node', 'node_uri']
-
if job_id and resources is False:
req = "GET_jobs_id"
if job_id and resources :
req = "GET_jobs_id_resources"
node_list_k = 'reserved_resources'
-
-
#Get job info from OAR
job_info = self.oar.parser.SendRequest(req, job_id, username)
for node in node_list:
node_hostname_list.append(node['hostname'])
node_dict = dict(zip(node_hostname_list,node_list))
-
-
try :
-
-
liste =job_info[node_list_k]
print>>sys.stderr, "\r\n \r\n \t\t GetJobs resources job_info liste%s" %(liste)
for k in range(len(liste)):
except KeyError:
print>>sys.stderr, "\r\n \r\n \t\t GetJobs KEYERROR "
-
-
-
-
+ def GetReservedNodes(self):
+ # this function returns a list of all the nodes already involved in an oar job
+
+ jobs=self.oar.parser.SendRequest("GET_jobs_details")
+ nodes=[]
+ for j in jobs :
+ nodes=j['assigned_network_address']+nodes
+ return nodes
def GetNodes(self,node_filter= None, return_fields=None):