'Gives the system user pwent entry based on e-mail or username depending
on the value in real_system_username'

def system_user_pwent(self, real_system_username):

    system_user_pwent = None
    if (real_system_username == 'user_email'):
        try:
            system_user_pwent = pwd.getpwnam(self.email.split('@')[0])
        except KeyError:
            pass
    elif (real_system_username == 'username'):
        try:
            system_user_pwent = pwd.getpwnam(self.username)
        except KeyError:
            pass
    else:
        try:
            system_user_pwent = pwd.getpwnam(real_system_username)
        except KeyError:
            log.warning('invalid    configuration    of    real_system_username')
            system_user_pwent = None
            pass
    return system_user_pwent
