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:
pooja jadhav
2017-12-13 12:56:15 +05:30
parent 440f8d82aa
commit 2a478b3528
5 changed files with 5 additions and 23 deletions

View File

@@ -45,12 +45,9 @@ class GroupSnapshotsTest(utils.TestCase):
def test_create_group_snapshot_with_group_id(self):
snap = cs.group_snapshots.create('1234')
expected = {'group_snapshot': {'status': 'creating',
'description': None,
'user_id': None,
expected = {'group_snapshot': {'description': None,
'name': None,
'group_id': '1234',
'project_id': None}}
'group_id': '1234'}}
cs.assert_called('POST', '/group_snapshots', body=expected)
self._assert_request_id(snap)

View File

@@ -45,14 +45,11 @@ class GroupsTest(utils.TestCase):
def test_create_group_with_volume_types(self):
grp = cs.groups.create('my_group_type', 'type1,type2', name='group')
expected = {'group': {'status': 'creating',
'description': None,
expected = {'group': {'description': None,
'availability_zone': None,
'user_id': None,
'name': 'group',
'group_type': 'my_group_type',
'volume_types': ['type1', 'type2'],
'project_id': None}}
'volume_types': ['type1', 'type2']}}
cs.assert_called('POST', '/groups', body=expected)
self._assert_request_id(grp)

View File

@@ -594,9 +594,6 @@ class ShellTest(utils.TestCase):
def test_group_create(self):
expected = {'group': {'name': 'test-1',
'description': 'test-1-desc',
'user_id': None,
'project_id': None,
'status': 'creating',
'group_type': 'my_group_type',
'volume_types': ['type1', 'type2'],
'availability_zone': 'zone1'}}
@@ -642,10 +639,7 @@ class ShellTest(utils.TestCase):
def test_group_snapshot_create(self):
expected = {'group_snapshot': {'name': 'test-1',
'description': 'test-1-desc',
'user_id': None,
'project_id': None,
'group_id': '1234',
'status': 'creating'}}
'group_id': '1234'}}
self.run_command('--os-volume-api-version 3.14 '
'group-snapshot-create --name test-1 '
'--description test-1-desc 1234')

View File

@@ -62,9 +62,6 @@ class GroupSnapshotManager(base.ManagerWithFind):
'group_id': group_id,
'name': name,
'description': description,
'user_id': user_id,
'project_id': project_id,
'status': "creating",
}
}

View File

@@ -81,10 +81,7 @@ class GroupManager(base.ManagerWithFind):
'description': description,
'group_type': group_type,
'volume_types': volume_types.split(','),
'user_id': user_id,
'project_id': project_id,
'availability_zone': availability_zone,
'status': "creating",
}}
return self._create('/groups', body, 'group')