Add group_type_id in create_group_snapshot
group_type_id should be set when a group_snapshot is created, however it was missed in the code. This patch adds the missing group_type_id in create_group_snapshot. Change-Id: I5fdb3324e19f53a1116a04fcb34f6776c42a798d Closes-Bug: #1632265
This commit is contained in:
parent
95f3f966ff
commit
7aab553313
|
@ -759,7 +759,8 @@ class API(base.Base):
|
||||||
'project_id': context.project_id,
|
'project_id': context.project_id,
|
||||||
'status': "creating",
|
'status': "creating",
|
||||||
'name': name,
|
'name': name,
|
||||||
'description': description}
|
'description': description,
|
||||||
|
'group_type_id': group.group_type_id}
|
||||||
|
|
||||||
group_snapshot = None
|
group_snapshot = None
|
||||||
group_snapshot_id = None
|
group_snapshot_id = None
|
||||||
|
|
|
@ -290,6 +290,7 @@ class GroupAPITestCase(test.TestCase):
|
||||||
name = "fake_name"
|
name = "fake_name"
|
||||||
description = "fake description"
|
description = "fake description"
|
||||||
mock_group.id = fake.GROUP_ID
|
mock_group.id = fake.GROUP_ID
|
||||||
|
mock_group.group_type_id = fake.GROUP_TYPE_ID
|
||||||
mock_group.volumes = []
|
mock_group.volumes = []
|
||||||
ret_group_snap = self.group_api.create_group_snapshot(
|
ret_group_snap = self.group_api.create_group_snapshot(
|
||||||
self.ctxt, mock_group, name, description)
|
self.ctxt, mock_group, name, description)
|
||||||
|
@ -300,7 +301,8 @@ class GroupAPITestCase(test.TestCase):
|
||||||
'project_id': self.ctxt.project_id,
|
'project_id': self.ctxt.project_id,
|
||||||
'status': "creating",
|
'status': "creating",
|
||||||
'name': name,
|
'name': name,
|
||||||
'description': description}
|
'description': description,
|
||||||
|
'group_type_id': fake.GROUP_TYPE_ID}
|
||||||
mock_group_snap.assert_called_once_with(self.ctxt, **options)
|
mock_group_snap.assert_called_once_with(self.ctxt, **options)
|
||||||
ret_group_snap.create.assert_called_once_with()
|
ret_group_snap.create.assert_called_once_with()
|
||||||
mock_create_in_db.assert_called_once_with(self.ctxt, [],
|
mock_create_in_db.assert_called_once_with(self.ctxt, [],
|
||||||
|
|
Loading…
Reference in New Issue