From: Mark Huang Date: Fri, 20 Oct 2006 18:15:40 +0000 (+0000) Subject: - fix case when caller has no keys X-Git-Tag: pycurl-7_13_1~500 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1c4f3478e0f262198d71a79358d614e07b6cdd0f;p=plcapi.git - fix case when caller has no keys --- diff --git a/PLC/Methods/GetKeys.py b/PLC/Methods/GetKeys.py index de0eb135..82c7ffcd 100644 --- a/PLC/Methods/GetKeys.py +++ b/PLC/Methods/GetKeys.py @@ -25,11 +25,10 @@ class GetKeys(Method): def call(self, auth, key_ids = None): # If we are not admin, make sure to only return our own keys if 'admin' not in self.caller['roles']: + key_ids = set(key_ids).intersection(self.caller['key_ids']) if not key_ids: - key_ids = self.caller['key_ids'] - else: - key_ids = set(self.caller['key_ids']).intersection(key_ids) - + return [] + keys = Keys(self.api, key_ids).values() # Turn each key into a real dict