def destroy(parsed): driver = nodelib.get_driver(parsed.secret_key, parsed.userid, parsed.provider) if nodelib.destroy_by_name(parsed.name, driver): return 0 else: print('ERROR: unable to destroy node', file=sys.stderr) return 1
def broken_node_lifecycle(self): deployment = nodelib.Deployment() driver = nodelib.get_driver(config.DEFAULT_SECRET_KEY, config.DEFAULT_USERID, config.DEFAULT_PROVIDER) node = deployment.deploy(driver) import time; time.sleep(10) assert node.destroy() assert node.name not in [n.name for n in driver.list_nodes()]
def deploy(args=None): parsed = config.reconfig(parser, args) deployment = nodelib.Deployment(name=parsed.name, bundles=parsed.bundles, prefix=parsed.prefix, image_name=parsed.image, subvars=parsed.subvars) driver = nodelib.get_driver(parsed.secret_key, parsed.userid, parsed.provider) node = deployment.deploy(driver, parsed.location, parsed.size) if parsed.verbose: print(node) if parsed.description_file: node.write_json(parsed.description_file) return node
def print_list(): parsed = config.reconfig(parser) driver = nodelib.get_driver(parsed.secret_key, parsed.userid, parsed.provider) [print('%s %s' % (n.name, n.public_ip[0])) for n in nodelib.list_nodes(driver)]