예제 #1
0
def main():
    controller = 'maas'  # bundle specifies series, so leave it unset.
    clean(controller)
    bootstrap(controller, params={'to': 'mal.maas'})
    deploy_bundle('openstack-base', 42)
    wait()
    pprint(status())
예제 #2
0
def main():
    controllers = ['maas-trusty', 'maas-xenial', 'maas-precise']

    # first kill everything
    for controller in controllers + ['maas']:
        clean(controller)

    # now boot on everything
    for controller in controllers:
        bootstrap(controller, params={'to': 'zoe.maas'})
        # bootstrap(controller, params={'to': 'mal.maas'})
        juju('add-machine')
        wait()
        pprint(status())
        clean(controller)
예제 #3
0
def check(vlans):
    services = status()['services']
    for service in services.values():
        for unit in service['units']:
            for relation in service['relations'].keys():
                address = service_address(unit, relation)

                found = False
                for vlan in vlans:
                    if ipaddress.IPv4Address(address) in vlan.network.hosts():
                        print(unit, relation, address, 'in', vlan.name)
                        found = True
                        continue

                if not found:
                    print(unit, relation, address, 'not in a VLAN')
예제 #4
0
        kwargs={
            'quiet': True,
            'write_to': connections[name]['file'],
            'empty_return': True,
    })
    print cmd, 'to', file_name
    connections[name]['thread'].start()


logs = glob('*.log')
for l in logs:
    os.remove(l)

while True:
    try:
        s = wand.status()

        for name, m in s['machines'].iteritems():
            if name not in connections and 'dns-name' in m:
                connect(name, 'machine', m['dns-name'])

    except subprocess.CalledProcessError:
        pass

    # Clean up dead connections.
    dead = []
    for name, info in connections.iteritems():
        if not info['thread'].isAlive():
            print name, 'is dead'
            dead.append(name)