Exemplo n.º 1
0
 def inventory(self):
     """ Sets up a class property named inventory, this is the getter
     It will pull in the file if the property is empty, otherwise just returns the variable
     """
     if self._inventory is None:
         self._inventory = multi_inventory.MultiInventory(None).run()
     return self._inventory
    def __init__(self, name):
        """ Init the cluster class """

        self._name = name
        self._openshift_version = None
        self._docker_version = None
        self.inventory = multi_inventory.MultiInventory(None).run()
        self._master_config = None
Exemplo n.º 3
0
    def get_inventory(args=None, cached=False):
        """Calls the inventory script and returns a dictionary containing the inventory."

        Keyword arguments:
        args -- optional arguments to pass to the inventory script
        """
        minv = multi_inventory.MultiInventory(args)
        if cached:
            minv.get_inventory_from_cache()
        else:
            minv.run()
        return minv.result
Exemplo n.º 4
0
    def get_inventory(self, args=None):
        """Calls the inventory script and returns a dictionary containing the inventory."

        Keyword arguments:
        args -- optional arguments to pass to the inventory script
        """
        t_args = None
        if args:
            t_args = args
        elif self.cached:
            t_args = {'from_cache': self.cached}

        minv = multi_inventory.MultiInventory(t_args)
        return minv.run()