Exemple #1
0
    def __getitem__(self, key):
        """ Function __getitem__
        Get an hostgroup

        @param key: The hostgroup name or ID
        @return RETURN: The ItemHostsGroup object of an host
        """
        # Because Hostgroup did not support get by name we need to do it by id
        if type(key) is not int:
            key = self.listName()[key]
        return ForemanObjects.__getitem__(self, key)
    def __getitem__(self, key):
        """ Function __getitem__
        Get an hostgroup

        @param key: The hostgroup name or ID
        @return RETURN: The ItemHostsGroup object of an host
        """
        # Because Hostgroup did not support get by name we need to do it by id
        if type(key) is not int:
            key = self.listName()[key]
        return ForemanObjects.__getitem__(self, key)