diff --git a/confluent_server/confluent/syncfiles.py b/confluent_server/confluent/syncfiles.py index d9586f44..b5d6c277 100644 --- a/confluent_server/confluent/syncfiles.py +++ b/confluent_server/confluent/syncfiles.py @@ -128,15 +128,34 @@ class SyncList(object): try: uid = pwd.getpwnam(optval).pw_uid except KeyError: - uid = None - optval = {'name': optval, 'id': uid} + try: + uid = int(optval) + optval = None + except ValueError: + uid = None + if optval: + optval = {'name': optval} + else: + optval = {} + if uid is not None: + optval['id'] = uid elif optname == 'group': try: gid = grp.getgrnam(optval).gr_gid except KeyError: - gid = None - optval = {'name': optval, 'id': gid} - entopts[optname] = optval + try: + gid = int(optval) + optval = None + except ValueError: + gid = None + if optval: + optval = {'name': optval} + else: + optval = {} + if gid is not None: + optval['id'] = gid + if optval: + entopts[optname] = optval currmap[k] = v targ = v if v else k for f in targ.split():