From: Thierry Parmentelat Date: Mon, 25 Jan 2010 15:30:21 +0000 (+0000) Subject: tweaked to work X-Git-Tag: PLCAPI-5.0-1^2~14 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2dcf4dbbf8f7b8dc0bb1a459a9062fedd672a28e;p=plcapi.git tweaked to work --- diff --git a/Makefile b/Makefile index 04756d91..d2e44b02 100644 --- a/Makefile +++ b/Makefile @@ -113,12 +113,12 @@ tags: # (*) otherwise, entering through the root context # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr +PLCHOST ?= testplc.onelab.eu + ifdef GUEST -ifdef PLCHOST SSHURL:=root@$(PLCHOST):/vservers/$(GUEST) SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) endif -endif ifdef PLC SSHURL:=root@$(PLC):/ SSHCOMMAND:=ssh root@$(PLC) diff --git a/PLC/Methods/GetNodeFlavour.py b/PLC/Methods/GetNodeFlavour.py index bcc60ca1..8c3489f2 100644 --- a/PLC/Methods/GetNodeFlavour.py +++ b/PLC/Methods/GetNodeFlavour.py @@ -25,7 +25,7 @@ class GetNodeFlavour(Method): accepts = [ Auth(), Mixed(Node.fields['node_id'], - Node.fields['name']), + Node.fields['hostname']), ] returns = { 'nodefamily' : Parameter (str, "the node-family this node should be based upon"), @@ -35,7 +35,7 @@ class GetNodeFlavour(Method): ########## nodefamily - def nodefamily (self, auth, nodeid): + def nodefamily (self, auth, node_id): # the deployment tag, if set, wins deployment = GetNodeDeployment (self.api).call(auth,node_id) @@ -55,10 +55,13 @@ class GetNodeFlavour(Method): return "%s-%s"%(pldistro,arch) def extensions (self, auth, node_id): - return GetNodeExtensions(self.api).call(auth,node_id).split() + try: + return GetNodeExtensions(self.api).call(auth,node_id).split() + except: + return [] def compressed (self, auth, node_id): - return not PlainBootstrapfs(self.api).call(auth,node_id) + return not not not GetNodePlainBootstrapfs(self.api).call(auth,node_id) def call(self, auth, node_id_or_name): # Get node information @@ -68,6 +71,7 @@ class GetNodeFlavour(Method): node = nodes[0] node_id = node['node_id'] + # xxx could use some sanity checking, and could provide fallbacks return { 'nodefamily' : self.nodefamily(auth,node_id), 'extensions' : self.extensions(auth,node_id), 'compressed' : self.compressed(auth,node_id),