diff --git a/manilaclient/base.py b/manilaclient/base.py index f7bb498de..f9856b1e9 100644 --- a/manilaclient/base.py +++ b/manilaclient/base.py @@ -219,5 +219,5 @@ class ManagerWithFind(Manager): return found - def list(self): + def list(self, search_opts=None): raise NotImplementedError diff --git a/manilaclient/tests/unit/v2/test_share_export_locations.py b/manilaclient/tests/unit/v2/test_share_export_locations.py index 614d693ef..14be78993 100644 --- a/manilaclient/tests/unit/v2/test_share_export_locations.py +++ b/manilaclient/tests/unit/v2/test_share_export_locations.py @@ -42,7 +42,7 @@ class ShareExportLocationsTest(utils.TestCase): def test_list_of_export_locations(self): share_id = '1234' - cs.share_export_locations.list(share_id) + cs.share_export_locations.list(share_id, search_opts=None) cs.assert_called( 'GET', '/shares/%s/export_locations' % share_id) diff --git a/manilaclient/tests/unit/v2/test_share_group_type_access.py b/manilaclient/tests/unit/v2/test_share_group_type_access.py index b4940b494..b09656cd3 100644 --- a/manilaclient/tests/unit/v2/test_share_group_type_access.py +++ b/manilaclient/tests/unit/v2/test_share_group_type_access.py @@ -58,7 +58,7 @@ class ShareGroupTypeAccessManagerTest(utils.TestCase): self.manager, '_list', mock.Mock(return_value=[fake_share_group_type_access])) - result = self.manager.list(fake.ShareGroupType()) + result = self.manager.list(fake.ShareGroupType(), search_opts=None) self.assertEqual([fake_share_group_type_access], result) mock_list.assert_called_once_with( diff --git a/manilaclient/tests/unit/v2/test_share_group_types.py b/manilaclient/tests/unit/v2/test_share_group_types.py index ebeec5047..009b4f53f 100644 --- a/manilaclient/tests/unit/v2/test_share_group_types.py +++ b/manilaclient/tests/unit/v2/test_share_group_types.py @@ -188,7 +188,7 @@ class ShareGroupTypeManagerTest(utils.TestCase): self.manager, '_list', mock.Mock(return_value=[fake_share_group_type])) - result = self.manager.list() + result = self.manager.list(search_opts=None) self.assertEqual([fake_share_group_type], result) mock_list.assert_called_once_with( diff --git a/manilaclient/tests/unit/v2/test_share_instance_export_locations.py b/manilaclient/tests/unit/v2/test_share_instance_export_locations.py index 920dbaef0..5bf8503a8 100644 --- a/manilaclient/tests/unit/v2/test_share_instance_export_locations.py +++ b/manilaclient/tests/unit/v2/test_share_instance_export_locations.py @@ -43,7 +43,8 @@ class ShareInstanceExportLocationsTest(utils.TestCase): def test_list_of_export_locations(self): share_instance_id = '1234' - cs.share_instance_export_locations.list(share_instance_id) + cs.share_instance_export_locations.list( + share_instance_id, search_opts=None) cs.assert_called( 'GET', '/share_instances/%s/export_locations' % share_instance_id) diff --git a/manilaclient/tests/unit/v2/test_share_instances.py b/manilaclient/tests/unit/v2/test_share_instances.py index 890e70836..1e1ce99a1 100644 --- a/manilaclient/tests/unit/v2/test_share_instances.py +++ b/manilaclient/tests/unit/v2/test_share_instances.py @@ -38,7 +38,7 @@ class ShareInstancesTest(utils.TestCase): return share_instances.ShareInstanceManager(api=mock_microversion) def test_list(self): - cs.share_instances.list() + cs.share_instances.list(search_opts=None) cs.assert_called('GET', '/share_instances') @ddt.data(('id', 'b4991315-eb7d-43ec-979e-5715d4399827'), diff --git a/manilaclient/tests/unit/v2/test_share_replicas.py b/manilaclient/tests/unit/v2/test_share_replicas.py index c67a5f51b..86abd151b 100644 --- a/manilaclient/tests/unit/v2/test_share_replicas.py +++ b/manilaclient/tests/unit/v2/test_share_replicas.py @@ -95,7 +95,7 @@ class ShareReplicasTest(utils.TestCase): def test_list(self): with mock.patch.object(self.manager, '_list', mock.Mock()): - self.manager.list() + self.manager.list(search_opts=None) self.manager._list.assert_called_once_with( share_replicas.RESOURCES_PATH + '/detail', share_replicas.RESOURCES_NAME) diff --git a/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py b/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py index abee2e5fa..4c248177b 100644 --- a/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py +++ b/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py @@ -30,7 +30,7 @@ cs = fakes.FakeClient(extensions=extensions) class ShareSnapshotExportLocationsTest(utils.TestCase): def test_list_snapshot(self): snapshot_id = '1234' - cs.share_snapshot_export_locations.list(snapshot_id) + cs.share_snapshot_export_locations.list(snapshot_id, search_opts=None) cs.assert_called( 'GET', '/snapshots/%s/export-locations' % snapshot_id) diff --git a/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py b/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py index 40b34649e..686093c2b 100644 --- a/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py +++ b/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py @@ -31,7 +31,7 @@ class ShareSnapshotInstanceExportLocationsTest(utils.TestCase): def test_list_snapshot_instance(self): snapshot_instance_id = '1234' cs.share_snapshot_instance_export_locations.list( - snapshot_instance_id) + snapshot_instance_id, search_opts=None) cs.assert_called( 'GET', '/snapshot-instances/%s/export-locations' % snapshot_instance_id) diff --git a/manilaclient/tests/unit/v2/test_share_snapshot_instances.py b/manilaclient/tests/unit/v2/test_share_snapshot_instances.py index 0a53adb3c..24398fb97 100644 --- a/manilaclient/tests/unit/v2/test_share_snapshot_instances.py +++ b/manilaclient/tests/unit/v2/test_share_snapshot_instances.py @@ -47,7 +47,7 @@ class SnapshotInstancesTest(utils.TestCase): else: url = '/snapshot-instances' self.mock_object(self.manager, '_list', mock.Mock()) - self.manager.list(detailed=detailed) + self.manager.list(detailed=detailed, search_opts=None) self.manager._list.assert_called_once_with(url, 'snapshot_instances') @ddt.data(True, False) diff --git a/manilaclient/tests/unit/v2/test_type_access.py b/manilaclient/tests/unit/v2/test_type_access.py index 39f6a6325..40bbb59f4 100644 --- a/manilaclient/tests/unit/v2/test_type_access.py +++ b/manilaclient/tests/unit/v2/test_type_access.py @@ -49,7 +49,7 @@ class TypeAccessTest(utils.TestCase): with mock.patch.object(manager, '_list', mock.Mock(return_value=fake_access_list)): - access = manager.list(share_type=share_type) + access = manager.list(share_type=share_type, search_opts=None) manager._list.assert_called_once_with( "/types/3/%s" % action_name, "share_type_access") diff --git a/manilaclient/v2/share_export_locations.py b/manilaclient/v2/share_export_locations.py index 65dac2dd7..1effa61cd 100644 --- a/manilaclient/v2/share_export_locations.py +++ b/manilaclient/v2/share_export_locations.py @@ -33,7 +33,7 @@ class ShareExportLocationManager(base.ManagerWithFind): resource_class = ShareExportLocation @api_versions.wraps("2.9") - def list(self, share): + def list(self, share, search_opts=None): """List all share export locations.""" share_id = common_base.getid(share) return self._list("/shares/%s/export_locations" % share_id, diff --git a/manilaclient/v2/share_group_type_access.py b/manilaclient/v2/share_group_type_access.py index 4e4facb92..cb300e183 100644 --- a/manilaclient/v2/share_group_type_access.py +++ b/manilaclient/v2/share_group_type_access.py @@ -34,7 +34,7 @@ class ShareGroupTypeAccessManager(base.ManagerWithFind): @api_versions.wraps("2.31") @api_versions.experimental_api - def list(self, share_group_type): + def list(self, share_group_type, search_opts=None): if share_group_type.is_public: return None share_group_type_id = common_base.getid(share_group_type) diff --git a/manilaclient/v2/share_group_types.py b/manilaclient/v2/share_group_types.py index df938b5ce..7a49584d8 100644 --- a/manilaclient/v2/share_group_types.py +++ b/manilaclient/v2/share_group_types.py @@ -131,7 +131,7 @@ class ShareGroupTypeManager(base.ManagerWithFind): @api_versions.wraps("2.31") @api_versions.experimental_api - def list(self, show_all=True): + def list(self, show_all=True, search_opts=None): """Get a list of all share group types. :rtype: list of :class:`ShareGroupType`. diff --git a/manilaclient/v2/share_instance_export_locations.py b/manilaclient/v2/share_instance_export_locations.py index 6116efcff..bd21edc55 100644 --- a/manilaclient/v2/share_instance_export_locations.py +++ b/manilaclient/v2/share_instance_export_locations.py @@ -33,7 +33,7 @@ class ShareInstanceExportLocationManager(base.ManagerWithFind): resource_class = ShareInstanceExportLocation @api_versions.wraps("2.9") - def list(self, share_instance): + def list(self, share_instance, search_opts=None): """List all share export locations.""" share_instance_id = common_base.getid(share_instance) return self._list( diff --git a/manilaclient/v2/share_instances.py b/manilaclient/v2/share_instances.py index 914c59cca..79ceaa553 100644 --- a/manilaclient/v2/share_instances.py +++ b/manilaclient/v2/share_instances.py @@ -49,12 +49,12 @@ class ShareInstanceManager(base.ManagerWithFind): return self._get("/share_instances/%s" % share_id, "share_instance") @api_versions.wraps("2.3", "2.34") - def list(self): + def list(self, search_opts=None): """List all share instances.""" return self.do_list() @api_versions.wraps("2.35") # noqa - def list(self, export_location=None): + def list(self, export_location=None, search_opts=None): """List all share instances.""" return self.do_list(export_location) diff --git a/manilaclient/v2/share_replicas.py b/manilaclient/v2/share_replicas.py index 18f1312e4..05f714555 100644 --- a/manilaclient/v2/share_replicas.py +++ b/manilaclient/v2/share_replicas.py @@ -63,10 +63,11 @@ class ShareReplicaManager(base.ManagerWithFind): @api_versions.wraps("2.11") @api_versions.experimental_api - def list(self, share=None): + def list(self, share=None, search_opts=None): """List all share replicas or list replicas belonging to a share. :param share: either share object or its UUID. + :param search_opts: default None :rtype: list of :class:`ShareReplica` """ diff --git a/manilaclient/v2/share_snapshot_export_locations.py b/manilaclient/v2/share_snapshot_export_locations.py index 7b7881ee8..86ef0dae8 100644 --- a/manilaclient/v2/share_snapshot_export_locations.py +++ b/manilaclient/v2/share_snapshot_export_locations.py @@ -38,7 +38,7 @@ class ShareSnapshotExportLocationManager(base.ManagerWithFind): resource_class = ShareSnapshotExportLocation @api_versions.wraps("2.32") - def list(self, snapshot=None): + def list(self, snapshot=None, search_opts=None): return self._list("/snapshots/%s/export-locations" % common_base.getid(snapshot), 'share_snapshot_export_locations') diff --git a/manilaclient/v2/share_snapshot_instance_export_locations.py b/manilaclient/v2/share_snapshot_instance_export_locations.py index 265bdc7eb..85fb678c6 100644 --- a/manilaclient/v2/share_snapshot_instance_export_locations.py +++ b/manilaclient/v2/share_snapshot_instance_export_locations.py @@ -38,7 +38,7 @@ class ShareSnapshotInstanceExportLocationManager(base.ManagerWithFind): resource_class = ShareSnapshotInstanceExportLocation @api_versions.wraps("2.32") - def list(self, snapshot_instance=None): + def list(self, snapshot_instance=None, search_opts=None): return self._list("/snapshot-instances/%s/export-locations" % common_base.getid(snapshot_instance), 'share_snapshot_export_locations') diff --git a/manilaclient/v2/share_snapshot_instances.py b/manilaclient/v2/share_snapshot_instances.py index 4f4903e1b..703fde79b 100644 --- a/manilaclient/v2/share_snapshot_instances.py +++ b/manilaclient/v2/share_snapshot_instances.py @@ -45,7 +45,7 @@ class ShareSnapshotInstanceManager(base.ManagerWithFind): "snapshot_instance") @api_versions.wraps("2.19") - def list(self, detailed=False, snapshot=None): + def list(self, detailed=False, snapshot=None, search_opts=None): """List all snapshot instances.""" if detailed: url = '/snapshot-instances/detail' diff --git a/manilaclient/v2/share_type_access.py b/manilaclient/v2/share_type_access.py index 0c7d332ec..b52316139 100644 --- a/manilaclient/v2/share_type_access.py +++ b/manilaclient/v2/share_type_access.py @@ -40,11 +40,11 @@ class ShareTypeAccessManager(base.ManagerWithFind): "share_type_access") @api_versions.wraps("1.0", "2.6") - def list(self, share_type): + def list(self, share_type, search_opts=None): return self._do_list(share_type, "os-share-type-access") @api_versions.wraps("2.7") # noqa - def list(self, share_type): + def list(self, share_type, search_opts=None): return self._do_list(share_type, "share_type_access") def add_project_access(self, share_type, project): diff --git a/releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml b/releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml new file mode 100755 index 000000000..2656198f9 --- /dev/null +++ b/releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Fixed bugs 1738917 and 1738918. Names can now be used in commands + pertaining to share group types.