Example #1
0
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
Example #2
0
def main():
    parsed = config.reconfig(parser)
    if parsed.verbose:
        print('parsed: {0}'.format(parsed))
    if parsed.testresults:
        try:
            dom = xml.dom.minidom.parse(parsed.testresults)
        except:
            print('ERROR: could not parse {0.testresults}, aborting destroy'.format(parsed),
                  file=sys.stderr)
            return 2
        suite = dom.getElementsByTagName('testsuite')[0]
        if int(suite.getAttribute('errors')) != 0 or int(suite.getAttribute('failures')) != 0:
            print('ERROR: not all tests passed, aborting destroy', file=sys.stderr)
            return 3
    return config.handle_errors(destroy, parsed)
Example #3
0
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)]