X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tools%2Freset_gids.py;h=e30ed329f796c35860c33acd77908c7865cd2545;hb=30d9951e075d93127c3909dcb41be09b420b3525;hp=f4b7da52a05b78b196039930835364e440e3f153;hpb=5404ec87098e28a160f3b53ccb751cd4086c7fa7;p=sfa.git diff --git a/tools/reset_gids.py b/tools/reset_gids.py index f4b7da52..e30ed329 100755 --- a/tools/reset_gids.py +++ b/tools/reset_gids.py @@ -1,8 +1,6 @@ #!/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 @@ -20,10 +18,9 @@ def fix_users(): uuid = create_uuid() pkey = Keypair(create=True) pub_key=getattr(record,'reg_keys',None) - print pub_key if len(pub_key) > 0: # 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()