git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- removed return_fields param
[plcapi.git]
/
PLC
/
Methods
/
AdmGetAllRoles.py
diff --git
a/PLC/Methods/AdmGetAllRoles.py
b/PLC/Methods/AdmGetAllRoles.py
index
6a80dd3
..
ea6c18f
100644
(file)
--- a/
PLC/Methods/AdmGetAllRoles.py
+++ b/
PLC/Methods/AdmGetAllRoles.py
@@
-1,7
+1,7
@@
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter
-from PLC.Roles import Roles
+from PLC.Roles import Role
, Role
s
from PLC.Auth import PasswordAuth
class AdmGetAllRoles(Method):
from PLC.Auth import PasswordAuth
class AdmGetAllRoles(Method):
@@
-20,13
+20,11
@@
class AdmGetAllRoles(Method):
returns = dict
def call(self, auth):
returns = dict
def call(self, auth):
- roles
= Roles(self.api
)
+ roles
_list = Roles(self.api).values(
)
- # Just the role_id: name mappings
- roles = dict(filter(lambda (role_id, name): isinstance(role_id, (int, long)), \
- roles.items()))
+ roles_dict = {}
+ for role in roles_list:
+ # Stringify the keys!
+ roles_dict[str(role['role_id'])] = role['name']
- # Stringify the keys!
- keys = map(str, roles.keys())
-
- return dict(zip(keys, roles.values()))
+ return roles_dict