Exemple #1
0
def driver_reset(driver='openstack', skip=None):
    """ Remove PERMANENTLY all machine within a driver class """

    mach = Dockerizing(driver)
    import time
    skip_nodes = []
    if skip is not None:
        skip_nodes = skip.split(',')
    # Find machines in list which are based on this driver
    for node in mach.list(with_driver=driver):
        if node in skip_nodes:
            _logger.info("Skipping '%s'" % node)

            continue
        # REMOVE THEM!!
        _logger.warning("Removing machine '%s'!" % node)
        time.sleep(5)
        mach.remove(node)
    _logger.info("Done")
Exemple #2
0
def machine_rm(node="dev", driver='virtualbox'):
    """ A task to remove an existing machine - on virtualbox """
    machine = Dockerizing(driver)

    # Check that the requested node does not already exist
    if node not in machine.list():
        print(colors.warn | "Failed:", colors.bold |
              "Machine '%s' does not exist" % node)
        return

    _logger.info(colors.bold | "Trying to remove '%s'" % node)
    print(machine.remove(node))
    _logger.info(colors.green | "Removed")