(self, sub_file, wanted_user)
return subid_list
get user information from the host /etc/sub*
get user information from the host /etc/sub*
get user information from the host / etc / sub *
def _user_in_subid(self, sub_file, wanted_user):
        """get user information from the host /etc/sub*"""
        subid_list = []
        if self.passwd_file:
            (user, dummy, dummy, dummy, dummy, dummy) = \
                    self._get_user_from_file(wanted_user)
        else:
            (user, dummy, dummy, dummy, dummy, dummy) = \
                    self._get_user_from_host(wanted_user)
        try:
            insub = open(sub_file)
        except (IOError, OSError):
            return []
        else:
            for line in insub:
                try:
                    (subuser, subid, count) = line.strip().split(':')
                except ValueError:
                    continue
                if subuser == user:
                    subid_list.extend([(subid, count), ])
            insub.close()
        return subid_list
def _user_in_subid ( self , sub_file , wanted_user ) : subid_list = [ ] if self . passwd_file : ( user , dummy , dummy , dummy , dummy , dummy ) = self . _get_user_from_file ( wanted_user ) else : ( user , dummy , dummy , dummy , dummy , dummy ) = self . _get_user_from_host ( wanted_user ) try : insub = open ( sub_file ) except ( IOError , OSError ) : return [ ] else : for line in insub : try : ( subuser , subid , count ) = line . strip ( ) . split ( ':' ) except ValueError : continue if subuser == user : subid_list . extend ( [ ( subid , count ) , ] ) insub . close ( ) return subid_list