diff --git a/cinderclient/tests/v2/test_consistencygroups.py b/cinderclient/tests/v2/test_consistencygroups.py index d9b01071b..234cb3ce9 100644 --- a/cinderclient/tests/v2/test_consistencygroups.py +++ b/cinderclient/tests/v2/test_consistencygroups.py @@ -33,11 +33,11 @@ class ConsistencygroupsTest(utils.TestCase): cs.assert_called('POST', '/consistencygroups/1234/delete') def test_create_consistencygroup(self): - cs.consistencygroups.create('cg') + cs.consistencygroups.create('type1,type2', 'cg') cs.assert_called('POST', '/consistencygroups') def test_create_consistencygroup_with_volume_types(self): - cs.consistencygroups.create('cg', volume_types='type1,type2') + cs.consistencygroups.create('type1,type2', 'cg') expected = {'consistencygroup': {'status': 'creating', 'description': None, 'availability_zone': None, diff --git a/cinderclient/v2/consistencygroups.py b/cinderclient/v2/consistencygroups.py index cbf911b0d..b20cb8b6f 100644 --- a/cinderclient/v2/consistencygroups.py +++ b/cinderclient/v2/consistencygroups.py @@ -42,8 +42,8 @@ class ConsistencygroupManager(base.ManagerWithFind): """Manage :class:`Consistencygroup` resources.""" resource_class = Consistencygroup - def create(self, name=None, description=None, - volume_types=None, user_id=None, + def create(self, volume_types, name=None, + description=None, user_id=None, project_id=None, availability_zone=None): """Creates a consistencygroup. diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index 2ff4a8228..7cfff15c6 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -1743,6 +1743,9 @@ def do_consisgroup_show(cs, args): utils.print_dict(info) +@utils.arg('volumetypes', + metavar='', + help='Volume types.') @utils.arg('--name', metavar='', help='Name of a consistency group.') @@ -1750,11 +1753,6 @@ def do_consisgroup_show(cs, args): metavar='', default=None, help='Description of a consistency group. Default=None.') -@utils.arg('--volume-types', - metavar='', - default=None, - help='Volume types. If not provided, default_volume_type ' - 'in cinder.conf must be specified. Default=None.') @utils.arg('--availability-zone', metavar='', default=None, @@ -1764,9 +1762,9 @@ def do_consisgroup_create(cs, args): """Creates a consistency group.""" consistencygroup = cs.consistencygroups.create( + args.volumetypes, args.name, args.description, - args.volume_types, availability_zone=args.availability_zone) info = dict()