def setUpClass(cls): super(MuranoBase, cls).setUpClass() cls.auth = ksclient.Client( username=cfg.murano.user, password=cfg.murano.password, tenant_name=cfg.murano.tenant, auth_url=cfg.murano.auth_url, ) cls.murano = murano_client(endpoint=cfg.murano.murano_url, token=cls.auth.auth_token)
help="Create or not create router after script", default=False) args = parser.parse_args() user = args.openstack_user password = args.openstack_password tenant = args.openstack_tenant keystone_url = args.keystone_url create_router = args.create_new_router keystone_client = ksclient.Client(username=user, password=password, tenant_name=tenant, auth_url=keystone_url) nova = nvclient.Client(user, password, tenant, keystone_url, service_type="compute") token = keystone_client.auth_token murano_url = args.murano_url muranoclient = murano_client(endpoint=murano_url, token=token) quantum_endpoint = args.neutron_url neutron = netclient.Client('2.0', endpoint_url=quantum_endpoint, token=token) heat_endpoint = args.heat_url heat = heat_client.Client('1', endpoint=heat_endpoint, token=token) for i in heat.stacks.list(): i.delete() networks = neutron.list_networks() for i in keystone_client.tenants.list(): if i.name == tenant: cool = i.id for i in muranoclient.environments.list(): muranoclient.environments.delete(i.id)