X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplc%2Fnodes.py;h=5c0777ae6bb15a716db758943d4fe090ada0a16d;hb=648d888ebc690e3dbcb17684f189880b9db57a97;hp=c057a625ddfb7ac7807679b32b8e0bbe994514e2;hpb=29d9f3fea7b205e52c235daea87ed5bfbf36e94d;p=sfa.git diff --git a/sfa/plc/nodes.py b/sfa/plc/nodes.py index c057a625..5c0777ae 100644 --- a/sfa/plc/nodes.py +++ b/sfa/plc/nodes.py @@ -24,7 +24,7 @@ class Nodes(SimpleStorage): self.api = api self.ttl = ttl self.threshold = None - path = self.api.config.SFA_BASE_DIR + path = self.api.config.SFA_DATA_DIR filename = ".".join([self.api.interface, self.api.hrn, "nodes"]) filepath = path + os.sep + filename self.nodes_file = filepath @@ -116,7 +116,8 @@ class Nodes(SimpleStorage): caller_cred = self.caller_cred # get the rspec from the aggregate try: - agg_rspec = aggregates[aggregate].get_resources(credential, hrn, caller_cred) + request_hash=None + agg_rspec = aggregates[aggregate].get_resources(credential, hrn, request_hash, caller_cred) except: arg_list = [credential, hrn] request_hash = self.api.key.compute_hash(arg_list) @@ -175,6 +176,7 @@ class Nodes(SimpleStorage): Get resource information from PLC """ + slicename = None # Get the required nodes if not hrn: nodes = self.api.plshell.GetNodes(self.api.plauth, {'peer_id': None}) @@ -192,7 +194,10 @@ class Nodes(SimpleStorage): # Filter out whitelisted nodes public_nodes = lambda n: n.has_key('slice_ids_whitelist') and not n['slice_ids_whitelist'] - nodes = filter(public_nodes, nodes) + + # ...only if they are not already assigned to this slice. + if (not slicename): + nodes = filter(public_nodes, nodes) # Get all network interfaces interface_ids = []