Beispiel #1
0
    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)
        if CONFIG.white_box:
            instance_info.nova_client = create_nova_client(instance_info.user)
            instance_info.volume_client = create_nova_client(
                instance_info.user,
                service_type=CONFIG.nova_client['volume_service_type'])
        global dbaas
        dbaas = instance_info.dbaas

        if CONFIG.white_box:
            user = instance_info.user.auth_user
            tenant = instance_info.user.tenant
            instance_info.user_context = context.RequestContext(user, tenant)
Beispiel #2
0
    def setUp(self):
        rd_user = test_config.users.find_user(Requirements(is_admin=False, services=["reddwarf"]))
        self.rd_client = create_dbaas_client(rd_user)

        if test_config.nova_client is not None:
            nova_user = test_config.users.find_user(Requirements(is_admin=False, services=["nova"]))
            self.nova_client = create_nova_client(nova_user)
Beispiel #3
0
    def setUp(self):
        rd_user = test_config.users.find_user(
            Requirements(is_admin=False, services=["reddwarf"]))
        self.rd_client = create_dbaas_client(rd_user)

        if test_config.nova_client is not None:
            nova_user = test_config.users.find_user(
                Requirements(is_admin=False, services=["nova"]))
            self.nova_client = create_nova_client(nova_user)