def ensure_home_directory(fs, user):
 userprofile = get_profile(user)
 if ((userprofile is not None) and userprofile.home_directory):
  fs.do_as_user(user.username, fs.create_home_dir, userprofile.home_directory)
 else:
  LOG.warn(('Not creating home directory of %s as his profile is empty' % user))

def ensure_home_directory ( fs , user ) : userprofile = get_profile ( user ) if ( ( userprofile is not None ) and userprofile . home_directory ) : fs . do_as_user ( user . username , fs . create_home_dir , userprofile . home_directory ) else : LOG . warn ( ( 'Not creating home directory of %s as his profile is empty' % user ) )
adds a users home directory if it doesnt already exist .