From 531974ce5d621b903608aa226110277f77918167 Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Wed, 4 Mar 2015 13:47:47 +0100 Subject: [PATCH] Fix: Reset GIDs works even if user has no pub_key --- tools/reset_gids.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/reset_gids.py b/tools/reset_gids.py index 453af297..f4b7da52 100755 --- a/tools/reset_gids.py +++ b/tools/reset_gids.py @@ -20,7 +20,8 @@ def fix_users(): uuid = create_uuid() pkey = Keypair(create=True) pub_key=getattr(record,'reg_keys',None) - if pub_key is not 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] pub_key = pub_key.key -- 2.43.0