X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tools%2Freset_gids.py;h=21e25cec949b6c191b676fe6936aa4cdd83d82a4;hb=11ec71d6e665c53ef3cf9cf1797cc3f3c77f2b1b;hp=453af29745091709a1fc8540b5fd00ca006a8062;hpb=206464bf5bb18cf88b62ebd1035a31f437532023;p=sfa.git diff --git a/tools/reset_gids.py b/tools/reset_gids.py index 453af297..21e25cec 100755 --- a/tools/reset_gids.py +++ b/tools/reset_gids.py @@ -20,7 +20,7 @@ def fix_users(): 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 if pub_key and isinstance(pub_key, types.ListType): pub_key = pub_key[0] pub_key = pub_key.key