Skip to content

Commit

Permalink
if there is no user exit with 50
Browse files Browse the repository at this point in the history
  • Loading branch information
szimszon authored and szimszon committed Feb 9, 2012
1 parent 00e68bb commit 9bf9e3d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions homedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ def __init__( self, config, userinfostore ):
self.log = self.config.log
self.username = userinfostore.get_username()
self.eusername = userinfostore.get_eusername()
from pwd import getpwnam
self.userid = getpwnam( self.username ).pw_uid
from grp import getgrnam
self.groupid = getgrnam( self.username ).gr_gid
try:
from pwd import getpwnam
self.userid = getpwnam( self.username ).pw_uid
from grp import getgrnam
self.groupid = getgrnam( self.username ).gr_gid
except:
import traceback
import sys
self.log.debug( 'There is no userid or groupid! Traceback: %s' % (
str( traceback.format_exc() ) ), 1 )
sys.exit( 50 )
import os
try:
cdir = self.config.get( 'homedir', 'dir' )
Expand Down

0 comments on commit 9bf9e3d

Please sign in to comment.