def destroy(servername, destroy_all=False, force=False): """ Kill a server, destroying its data. Achtung! Usage: fab provider.destroy:servername """ if not destroy_all and not force: reply = prompt("Permanently destroying '{0}'. Are you sure? y/N".format(servername)) if reply is not "y": abort("Did not destroy {0}".format(servername)) from bootmachine.core import configurator, master if not destroy_all: master() configurator.revoke(servername) local("openstack-compute delete {name} || true".format(name=servername))
def destroy(servername, destroy_all=False, force=False): """ Kill a server, destroying its data. Achtung! Usage: fab provider.destroy:servername """ if not destroy_all and not force: reply = prompt("Permanently destroying '{0}'. Are you sure? y/N".format(servername)) if reply is not "y": abort("Did not destroy {0}".format(servername)) from bootmachine.core import configurator, master if not destroy_all: master() configurator.revoke(servername) local("nova delete {name} || true".format(name=servername)) # calling list_servers immediately after deleting returns the deleted servers if not destroy_all: env.bootmachine_servers = list_servers(as_list=True) print("It may take up to a minute for a server to be completely deleted.")