print "not all tenants are found" sys.exit(1) tenantIds = map(lambda tenant: tenant.id, tenants) hosts = [ '00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0000-000000000003' ] addresses = ['10.0.0.8', '10.0.0.9', '10.0.0.10'] if not all(hosts): print "host uuid file(s) is not found" sys.exit(1) api = MidonetApi('http://127.0.0.1:8080/midonet-api', 'admin', '*') tx = Transaction() try: zone = TunnelZone({'name': 'zone0', 'type': 'gre'}) zone.add( api, tx, map(lambda h, a: TunnelZoneHost({ 'hostId': h, 'ipAddress': a }), hosts, addresses)) bridge = Bridge({'name': 'bridge0', 'tenantId': tenantIds[0]}) bridge.add( api, tx, map(lambda h: HostInterface({ 'hostId': h, 'name': 'veth0' }), hosts))