Believe it or not, some people have an empty group database.
Prevent the test from failing there.
This commit is contained in:
parent
095f35ad60
commit
30da0ea124
|
@ -12,11 +12,14 @@ if verbose:
|
|||
for group in groups:
|
||||
print group
|
||||
|
||||
if not groups:
|
||||
if verbose:
|
||||
print "Empty Group Database -- no further tests of grp module possible"
|
||||
else:
|
||||
group = grp.getgrgid(groups[0][2])
|
||||
if verbose:
|
||||
print 'Group Entry for GID %d: %s' % (groups[0][2], group)
|
||||
|
||||
group = grp.getgrgid(groups[0][2])
|
||||
if verbose:
|
||||
print 'Group Entry for GID %d: %s' % (groups[0][2], group)
|
||||
|
||||
group = grp.getgrnam(groups[0][0])
|
||||
if verbose:
|
||||
print 'Group Entry for group %s: %s' % (groups[0][0], group)
|
||||
group = grp.getgrnam(groups[0][0])
|
||||
if verbose:
|
||||
print 'Group Entry for group %s: %s' % (groups[0][0], group)
|
||||
|
|
Loading…
Reference in New Issue