Skip to content

Commit e31d0cd

Browse files
committed
Update userNames.py
1) 'has_key()' has been removed in Python 3.x 2) This should just work if we use the pwent.* values
1 parent 2feaac1 commit e31d0cd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/distro/userNames.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
}
2525

2626
for pwent in pwd.getpwall():
27-
if lsbUsers.has_key(pwent.pw_name):
27+
if pwent.pw_name in lsbUsers:
2828
if (pwent.pw_uid, pwent.pw_gid) != lsbUsers[pwent.pw_name]:
29-
print 'UID and or GID for user %s do not match specification' %usr
30-
print 'found: (', uid, ',', gid, ') expected: ', lsbUsers[usr]
29+
print 'UID and/or GID for user %s do not match specification' %pwent.pw_name
30+
print 'found: (', pwent.pw_uid, ',', pwent.pw_gid, ') expected: ', lsbUsers[pwent.pw_name]
3131
sys.exit(1)
3232

3333
# TBD: get rid of un-sourced numeric constants

0 commit comments

Comments
 (0)