Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value...
[plcapi.git] / PLC / Methods / GetPCUs.py
index b894abd..c59fa40 100644 (file)
@@ -1,4 +1,3 @@
-# $Id$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -33,7 +32,7 @@ class GetPCUs(Method):
     returns = [PCU.fields]
 
     def call(self, auth, pcu_filter = None, return_fields = None):
-       # If we are not admin
+        # If we are not admin
         if not (isinstance(self.caller, Person) and 'admin' in self.caller['roles']):
             # Return only the PCUs at our site
             valid_pcu_ids = []
@@ -63,12 +62,12 @@ class GetPCUs(Method):
 
         # Filter out PCUs that are not viewable
         if not (isinstance(self.caller, Person) and 'admin' in self.caller['roles']):
-            pcus = filter(lambda pcu: pcu['pcu_id'] in valid_pcu_ids, pcus)
+            pcus = [pcu for pcu in pcus if pcu['pcu_id'] in valid_pcu_ids]
 
         # Remove pcu_id if not specified
         if added_fields:
             for pcu in pcus:
-               if 'pcu_id' in pcu:
-                   del pcu['pcu_id']
+                if 'pcu_id' in pcu:
+                    del pcu['pcu_id']
 
         return pcus