(self, user)
return user_id
Parse string with uid:gid or username
Parse string with uid:gid or username
Parse string with uid : gid or username
def _validate_user_str(self, user):
        """Parse string with uid:gid or username"""
        user_id = dict()
        if not is_genstr(user):
            return user_id

        if re.match("^[a-zA-Z_][a-zA-Z0-9_-]*$", user):
            user_id["user"] = user
            return user_id

        match = re.match("^(\\d+)(:(\\d+)){0,1}$", user)
        if match:
            user_id["uid"] = match.group(1)
            if match.group(3):
                user_id["gid"] = match.group(3)

        return user_id
def _validate_user_str ( self , user ) : user_id = dict ( ) if not is_genstr ( user ) : return user_id if re . match ( "^[a-zA-Z_][a-zA-Z0-9_-]*$" , user ) : user_id [ "user" ] = user return user_id match = re . match ( "^(\\d+)(:(\\d+)){0,1}$" , user ) if match : user_id [ "uid" ] = match . group ( 1 ) if match . group ( 3 ) : user_id [ "gid" ] = match . group ( 3 ) return user_id