client/tools/rhncfg/config_common/transactions.py | 16 +++++++++++----- client/tools/rhncfg/rhncfg.spec | 5 ++++- rel-eng/packages/rhncfg | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-)
New commits: commit 1f2cf61849cc039cea5dae14dc9121def578e44c Author: Michael Mraka michael.mraka@redhat.com Date: Fri Oct 4 15:35:24 2013 +0200
Automatic commit of package [rhncfg] release [5.10.64-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec index b1259d9..902c002 100644 --- a/client/tools/rhncfg/rhncfg.spec +++ b/client/tools/rhncfg/rhncfg.spec @@ -8,7 +8,7 @@ Group: Applications/System License: GPLv2 URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... -Version: 5.10.63 +Version: 5.10.64 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -120,6 +120,9 @@ fi
# $Id$ %changelog +* Fri Oct 04 2013 Michael Mraka michael.mraka@redhat.com 5.10.64-1 +- Adding fallback support for numeric UID/GID + * Mon Sep 30 2013 Michael Mraka michael.mraka@redhat.com 5.10.63-1 - removed trailing whitespaces
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg index 2c630bd..db0dade 100644 --- a/rel-eng/packages/rhncfg +++ b/rel-eng/packages/rhncfg @@ -1 +1 @@ -5.10.63-1 client/tools/rhncfg/ +5.10.64-1 client/tools/rhncfg/
commit 2844654af3ca8d80fc438acf7f552e0489f7cb3e Author: Michael Mraka michael.mraka@redhat.com Date: Fri Oct 4 15:31:14 2013 +0200
Adding fallback support for numeric UID/GID if lookup fails and username/groupname is numeric
Nick Piacentine npiace@mars.asu.edu
diff --git a/client/tools/rhncfg/config_common/transactions.py b/client/tools/rhncfg/config_common/transactions.py index 8e3f3d3..b449ac2 100644 --- a/client/tools/rhncfg/config_common/transactions.py +++ b/client/tools/rhncfg/config_common/transactions.py @@ -125,10 +125,13 @@ class DeployTransaction:
try: user_record = pwd.getpwnam(file_info['username']) + uid = user_record[2] except Exception, e: - raise cfg_exceptions.UserNotFound(file_info['username']), None, sys.exc_info()[2] - - uid = user_record[2] + #Check if username is an int + try: + uid = int(file_info['username']) + except ValueError: + raise cfg_exceptions.UserNotFound(file_info['username']), None, sys.exc_info()[2] else: #default to root (3.2 sats) uid = 0 @@ -139,10 +142,13 @@ class DeployTransaction: # determine gid try: group_record = grp.getgrnam(file_info['groupname']) + gid = group_record[2] except Exception, e: - raise cfg_exceptions.GroupNotFound(file_info['groupname']), None, sys.exc_info()[2] + try: + gid = int(file_info['groupname']) + except ValueError: + raise cfg_exceptions.GroupNotFound(file_info['groupname']), None, sys.exc_info()[2]
- gid = group_record[2] else: #default to root (3.2 sats) gid = 0
spacewalk-commits@lists.fedorahosted.org