From: Tony Mack Date: Fri, 11 Jan 2008 18:12:53 +0000 (+0000) Subject: fix bug that happen when node is the caller X-Git-Tag: PLCAPI-4.2-1~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=ee0717f6f326f2b1bcf34e8b10e306adb21f4ffa;p=plcapi.git fix bug that happen when node is the caller --- diff --git a/PLC/Methods/GetNodes.py b/PLC/Methods/GetNodes.py index 8e2931a..f4b577d 100644 --- a/PLC/Methods/GetNodes.py +++ b/PLC/Methods/GetNodes.py @@ -49,9 +49,13 @@ class GetNodes(Method): 'admin' not in self.caller['roles']: slice_ids = set() site_ids = set() + if self.caller: slice_ids.update(self.caller['slice_ids']) - site_ids.update(self.caller['site_ids']) + if isinstance(self.caller, Node): + site_ids.update([self.caller['site_id']]) + else: + site_ids.update(self.caller['site_ids']) # if node has whitelist, only return it if users is at # the same site or user has a slice on the whitelist