git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
deeper pass on xmlrpclib vs xmlrpc.client as well as configparser
[sfa.git]
/
tools
/
reset_gids.py
diff --git
a/tools/reset_gids.py
b/tools/reset_gids.py
index
453af29
..
e30ed32
100755
(executable)
--- a/
tools/reset_gids.py
+++ b/
tools/reset_gids.py
@@
-1,8
+1,6
@@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#!/usr/bin/env python
# -*- coding:utf-8 -*-
-import types
-
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
@@
-20,9
+18,9
@@
def fix_users():
uuid = create_uuid()
pkey = Keypair(create=True)
pub_key=getattr(record,'reg_keys',None)
uuid = create_uuid()
pkey = Keypair(create=True)
pub_key=getattr(record,'reg_keys',None)
- if
pub_key is not None
:
+ if
len(pub_key) > 0
:
# use only first key in record
# use only first key in record
- if pub_key and isinstance(pub_key,
types.ListType
): pub_key = pub_key[0]
+ if pub_key and isinstance(pub_key,
list
): pub_key = pub_key[0]
pub_key = pub_key.key
pkey = convert_public_key(pub_key)
urn = Xrn (xrn=record.hrn, type='user').get_urn()
pub_key = pub_key.key
pkey = convert_public_key(pub_key)
urn = Xrn (xrn=record.hrn, type='user').get_urn()