def setUp(self): rd_user = test_config.users.find_user(Requirements(is_admin=False, services=["trove"])) self.rd_client = create_dbaas_client(rd_user) if test_config.nova_client is not None: nova_user = test_config.users.find_user(Requirements(services=["nova"])) self.nova_client = create_nova_client(nova_user)
def setUp(self): """Sets up the client.""" reqs = Requirements(is_admin=True) instance_info.admin_user = CONFIG.users.find_user(reqs) instance_info.dbaas_admin = create_dbaas_client( instance_info.admin_user) global dbaas_admin dbaas_admin = instance_info.dbaas_admin # Make sure we create the client as the correct user if we're using # a pre-built instance. if existing_instance(): mgmt_inst = dbaas_admin.mgmt.instances.show(existing_instance()) t_id = mgmt_inst.tenant_id instance_info.user = CONFIG.users.find_user_by_tenant_id(t_id) else: reqs = Requirements(is_admin=False) instance_info.user = CONFIG.users.find_user(reqs) instance_info.dbaas = create_dbaas_client(instance_info.user) instance_info.nova_client = util.create_nova_client(instance_info.user) instance_info.flavors = instance_info.nova_client.flavors.list() global dbaas dbaas = instance_info.dbaas
def setUp(self): rd_user = test_config.users.find_user( Requirements(is_admin=False, services=["trove"])) self.rd_client = create_dbaas_client(rd_user) if test_config.nova_client is not None: nova_user = test_config.users.find_user( Requirements(services=["nova"])) self.nova_client = create_nova_client(nova_user)
def setUp(self): """Create client for tests.""" reqs = Requirements(is_admin=True) self.user = CONFIG.users.find_user(reqs) self.client = create_dbaas_client(self.user) if test_config.nova_client is not None: nova_user = test_config.users.find_user( Requirements(services=["nova"])) self.nova_client = create_nova_client(nova_user) self.images = self.nova_client.images.list()
def nova_client(self): if not self._nova_client: self._nova_client = create_nova_client(self.instance_info.user) return self._nova_client
def nova_client(self): return create_nova_client(self.instance_info.user)
def nova_client(self): if self._nova_client is None: self._nova_client = test_util.create_nova_client( self.instance_info.admin_user) return self._nova_client