def _create_cluster(self, cluster_id): values = { 'id': cluster_id, 'profile_id': 'some-profile', 'name': 'test_cluster', 'user': '******', 'project': 'project' } return db_api.cluster_create(self.context, values)
def _create_cluster(self, cluster_id): values = { 'id': cluster_id, 'profile_id': self.profile.id, 'name': 'test-cluster', 'user': self.context.user, 'project': self.context.project, } return db_api.cluster_create(self.context, values)
def _create_cluster(self, cluster_id): values = { "id": cluster_id, "profile_id": self.profile.id, "name": "test-cluster", "user": self.context.user, "project": self.context.project, } return db_api.cluster_create(self.context, values)
def _create_cluster(self, cluster_id, profile_id): values = { 'id': cluster_id, 'profile_id': profile_id, 'name': 'test-cluster', 'user': self.context.user, 'project': self.context.project, 'next_index': 1, 'min_size': 1, 'max_size': 5, 'desired_capacity': 3, } return db_api.cluster_create(self.context, values)
def create_cluster(ctx, profile, **kwargs): values = { 'name': 'db_test_cluster_name', 'profile_id': profile.id, 'user': ctx.user, 'project': ctx.project, 'domain': 'unknown', 'parent': None, 'next_index': 1, 'timeout': 60, 'desired_capacity': 0, 'init_at': tu.utcnow(), 'status': 'INIT', 'status_reason': 'Just Initialized', 'meta_data': {}, } values.update(kwargs) if 'project' in kwargs: values.update({'project': kwargs.get('project')}) return db_api.cluster_create(ctx, values)
def create_cluster(ctx, profile, **kwargs): values = { 'name': 'db_test_cluster_name', 'profile_id': profile.id, 'user': ctx.user, 'project': ctx.project, 'domain': 'unknown', 'parent': None, 'next_index': 1, 'timeout': 60, 'desired_capacity': 0, 'init_at': tu.utcnow(True), 'status': 'INIT', 'status_reason': 'Just Initialized', 'meta_data': {}, } values.update(kwargs) if 'project' in kwargs: values.update({'project': kwargs.get('project')}) return db_api.cluster_create(ctx, values)
def create_cluster(ctx, profile, **kwargs): values = { 'name': 'db_test_cluster_name', 'profile_id': profile.id, 'user': ctx.user, 'project': ctx.tenant_id, 'domain': 'unknown', 'parent': None, 'next_index': 1, 'timeout': 60, 'size': 0, 'init_time': datetime.datetime.utcnow(), 'status': 'INIT', 'status_reason': 'Just Initialized', 'tags': {}, } values.update(kwargs) if 'tenant_id' in kwargs: values.update({'project': kwargs.get('tenant_id')}) return db_api.cluster_create(ctx, values)
def test_to_dict(self, mock_load): values = { 'id': 'CLUSTER123', 'profile_id': 'PROFILE_ID', 'name': 'test-cluster', 'desired_capacity': 1, 'status': 'INIT', 'user': self.context.user, 'project': self.context.project, } cluster = db_api.cluster_create(self.context, values) expected = { 'id': cluster.id, 'name': cluster.name, 'profile_id': cluster.profile_id, 'user': cluster.user, 'project': cluster.project, 'domain': cluster.domain, 'init_at': mock.ANY, 'created_at': None, 'updated_at': None, 'min_size': 0, 'max_size': -1, 'desired_capacity': 1, 'timeout': cfg.CONF.default_action_timeout, 'status': 'INIT', 'status_reason': None, 'metadata': {}, 'data': None, 'nodes': [], 'policies': [], 'profile_name': None, } result = clusterm.Cluster.load(self.context, cluster_id='CLUSTER123') self.assertEqual(expected, result.to_dict())