Removed unnecessary parameters from group and group_snapshots create APIs
As per code, the 'status', 'user_id' and 'project_id' parameter is not required to be passed in the request body in case of group and group_snapshot create APIs. Even if you pass these parameter, it is silently ignored in the code. This patch removes those parameters passed in the request body. Change-Id: I29e7d4c8a3eee52f4ea7278d2edf2c7deec40628
This commit is contained in:
@@ -45,12 +45,9 @@ class GroupSnapshotsTest(utils.TestCase):
|
|||||||
|
|
||||||
def test_create_group_snapshot_with_group_id(self):
|
def test_create_group_snapshot_with_group_id(self):
|
||||||
snap = cs.group_snapshots.create('1234')
|
snap = cs.group_snapshots.create('1234')
|
||||||
expected = {'group_snapshot': {'status': 'creating',
|
expected = {'group_snapshot': {'description': None,
|
||||||
'description': None,
|
|
||||||
'user_id': None,
|
|
||||||
'name': None,
|
'name': None,
|
||||||
'group_id': '1234',
|
'group_id': '1234'}}
|
||||||
'project_id': None}}
|
|
||||||
cs.assert_called('POST', '/group_snapshots', body=expected)
|
cs.assert_called('POST', '/group_snapshots', body=expected)
|
||||||
self._assert_request_id(snap)
|
self._assert_request_id(snap)
|
||||||
|
|
||||||
|
@@ -45,14 +45,11 @@ class GroupsTest(utils.TestCase):
|
|||||||
|
|
||||||
def test_create_group_with_volume_types(self):
|
def test_create_group_with_volume_types(self):
|
||||||
grp = cs.groups.create('my_group_type', 'type1,type2', name='group')
|
grp = cs.groups.create('my_group_type', 'type1,type2', name='group')
|
||||||
expected = {'group': {'status': 'creating',
|
expected = {'group': {'description': None,
|
||||||
'description': None,
|
|
||||||
'availability_zone': None,
|
'availability_zone': None,
|
||||||
'user_id': None,
|
|
||||||
'name': 'group',
|
'name': 'group',
|
||||||
'group_type': 'my_group_type',
|
'group_type': 'my_group_type',
|
||||||
'volume_types': ['type1', 'type2'],
|
'volume_types': ['type1', 'type2']}}
|
||||||
'project_id': None}}
|
|
||||||
cs.assert_called('POST', '/groups', body=expected)
|
cs.assert_called('POST', '/groups', body=expected)
|
||||||
self._assert_request_id(grp)
|
self._assert_request_id(grp)
|
||||||
|
|
||||||
|
@@ -594,9 +594,6 @@ class ShellTest(utils.TestCase):
|
|||||||
def test_group_create(self):
|
def test_group_create(self):
|
||||||
expected = {'group': {'name': 'test-1',
|
expected = {'group': {'name': 'test-1',
|
||||||
'description': 'test-1-desc',
|
'description': 'test-1-desc',
|
||||||
'user_id': None,
|
|
||||||
'project_id': None,
|
|
||||||
'status': 'creating',
|
|
||||||
'group_type': 'my_group_type',
|
'group_type': 'my_group_type',
|
||||||
'volume_types': ['type1', 'type2'],
|
'volume_types': ['type1', 'type2'],
|
||||||
'availability_zone': 'zone1'}}
|
'availability_zone': 'zone1'}}
|
||||||
@@ -642,10 +639,7 @@ class ShellTest(utils.TestCase):
|
|||||||
def test_group_snapshot_create(self):
|
def test_group_snapshot_create(self):
|
||||||
expected = {'group_snapshot': {'name': 'test-1',
|
expected = {'group_snapshot': {'name': 'test-1',
|
||||||
'description': 'test-1-desc',
|
'description': 'test-1-desc',
|
||||||
'user_id': None,
|
'group_id': '1234'}}
|
||||||
'project_id': None,
|
|
||||||
'group_id': '1234',
|
|
||||||
'status': 'creating'}}
|
|
||||||
self.run_command('--os-volume-api-version 3.14 '
|
self.run_command('--os-volume-api-version 3.14 '
|
||||||
'group-snapshot-create --name test-1 '
|
'group-snapshot-create --name test-1 '
|
||||||
'--description test-1-desc 1234')
|
'--description test-1-desc 1234')
|
||||||
|
@@ -62,9 +62,6 @@ class GroupSnapshotManager(base.ManagerWithFind):
|
|||||||
'group_id': group_id,
|
'group_id': group_id,
|
||||||
'name': name,
|
'name': name,
|
||||||
'description': description,
|
'description': description,
|
||||||
'user_id': user_id,
|
|
||||||
'project_id': project_id,
|
|
||||||
'status': "creating",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -81,10 +81,7 @@ class GroupManager(base.ManagerWithFind):
|
|||||||
'description': description,
|
'description': description,
|
||||||
'group_type': group_type,
|
'group_type': group_type,
|
||||||
'volume_types': volume_types.split(','),
|
'volume_types': volume_types.split(','),
|
||||||
'user_id': user_id,
|
|
||||||
'project_id': project_id,
|
|
||||||
'availability_zone': availability_zone,
|
'availability_zone': availability_zone,
|
||||||
'status': "creating",
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
return self._create('/groups', body, 'group')
|
return self._create('/groups', body, 'group')
|
||||||
|
Reference in New Issue
Block a user