Hello community,
here is the log from the commit of package python-manilaclient for
openSUSE:Factory checked in at 2018-02-14 10:50:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-manilaclient (Old)
and /work/SRC/openSUSE:Factory/.python-manilaclient.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-manilaclient"
Wed Feb 14 10:50:36 2018 rev:11 rq:575939 version:1.21.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-manilaclient/python-manilaclient.changes
2018-01-24 15:27:03.096051585 +0100
+++
/work/SRC/openSUSE:Factory/.python-manilaclient.new/python-manilaclient.changes
2018-02-14 10:50:37.363841617 +0100
@@ -1,0 +2,13 @@
+Mon Feb 12 10:00:18 UTC 2018 - [email protected]
+
+- update to version 1.21.0 (bsc#1078607)
+ - Fix share can not be found by name in admin context
+ - Add 'count' in list command
+ - Add functional tests for MAPRFS protocal
+ - Avoid tox_install.sh for constraints support
+ - Add show share type detail command
+ - Added 'description' in share type
+ - Updated from global requirements
+ - Add search_opts in func list of ManagerWithFind type classes
+
+-------------------------------------------------------------------
Old:
----
python-manilaclient-1.19.0.tar.gz
New:
----
python-manilaclient-1.21.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-manilaclient.spec ++++++
--- /var/tmp/diff_new_pack.MAf1P5/_old 2018-02-14 10:50:38.063816427 +0100
+++ /var/tmp/diff_new_pack.MAf1P5/_new 2018-02-14 10:50:38.063816427 +0100
@@ -16,15 +16,14 @@
#
-%global sname python-manilaclient
Name: python-manilaclient
-Version: 1.19.0
+Version: 1.21.0
Release: 0
Summary: Client Library for OpenStack Share API
License: Apache-2.0
Group: Development/Languages/Python
-Url: https://launchpad.net/%{sname}
-Source0:
https://files.pythonhosted.org/packages/source/p/%{sname}/%{sname}-%{version}.tar.gz
+Url: https://launchpad.net/python-manilaclient
+Source0:
https://files.pythonhosted.org/packages/source/p/python-manilaclient/python-manilaclient-1.21.0.tar.gz
BuildRequires: openstack-macros
BuildRequires: openstack-tempest
BuildRequires: python-ddt >= 1.0.1
@@ -32,16 +31,17 @@
BuildRequires: python-fixtures >= 3.0.0
BuildRequires: python-mock >= 2.0.0
BuildRequires: python-openstackclient >= 3.12.0
-BuildRequires: python-oslotest >= 1.10.0
+BuildRequires: python-oslotest >= 3.2.0
BuildRequires: python-testrepository >= 0.0.18
BuildRequires: python-testtools >= 2.2.0
Requires: python-Babel >= 2.3.4
Requires: python-PrettyTable >= 0.7.1
+Requires: python-debtcollector >= 1.2.0
Requires: python-keystoneclient >= 3.8.0
-Requires: python-oslo.config >= 4.6.0
-Requires: python-oslo.log >= 3.30.0
+Requires: python-oslo.config >= 5.1.0
+Requires: python-oslo.log >= 3.36.0
Requires: python-oslo.serialization >= 2.18.0
-Requires: python-oslo.utils >= 3.31.0
+Requires: python-oslo.utils >= 3.33.0
Requires: python-requests >= 2.14.2
Requires: python-simplejson >= 3.5.1
Requires: python-six >= 1.10.0
@@ -71,7 +71,7 @@
Requires: python-fixtures >= 3.0.0
Requires: python-mock >= 2.0.0
Requires: python-openstackclient >= 3.12.0
-Requires: python-oslotest >= 1.10.0
+Requires: python-oslotest >= 3.2.0
Requires: python-testrepository >= 0.0.18
Requires: python-testtools >= 2.2.0
@@ -81,7 +81,7 @@
This package contains the testsuite.
%prep
-%autosetup -n %{sname}-%{version}
+%autosetup -p1 -n python-manilaclient-1.21.0
%py_req_cleanup
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg
++++++ python-manilaclient-1.19.0.tar.gz -> python-manilaclient-1.21.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/AUTHORS
new/python-manilaclient-1.21.0/AUTHORS
--- old/python-manilaclient-1.19.0/AUTHORS 2017-12-07 21:35:35.000000000
+0100
+++ new/python-manilaclient-1.21.0/AUTHORS 2018-01-26 01:35:28.000000000
+0100
@@ -38,6 +38,7 @@
Jan Provaznik <[email protected]>
Jeremy Liu <[email protected]>
Jeremy Stanley <[email protected]>
+Jiao Pengju <[email protected]>
Joe Gordon <[email protected]>
John Spray <[email protected]>
Julia Varlamova <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/ChangeLog
new/python-manilaclient-1.21.0/ChangeLog
--- old/python-manilaclient-1.19.0/ChangeLog 2017-12-07 21:35:35.000000000
+0100
+++ new/python-manilaclient-1.21.0/ChangeLog 2018-01-26 01:35:28.000000000
+0100
@@ -1,6 +1,22 @@
CHANGES
=======
+1.21.0
+------
+
+* Added 'description' in share type
+* Add 'count' in list command
+* Add show share type detail command
+* Add functional tests for MAPRFS protocal
+
+1.20.0
+------
+
+* Add search\_opts in func list of ManagerWithFind type classes
+* Fix share can not be found by name in admin context
+* Updated from global requirements
+* Avoid tox\_install.sh for constraints support
+
1.19.0
------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/PKG-INFO
new/python-manilaclient-1.21.0/PKG-INFO
--- old/python-manilaclient-1.19.0/PKG-INFO 2017-12-07 21:35:37.000000000
+0100
+++ new/python-manilaclient-1.21.0/PKG-INFO 2018-01-26 01:35:29.000000000
+0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-manilaclient
-Version: 1.19.0
+Version: 1.21.0
Summary: Client library for OpenStack Manila API.
Home-page: https://docs.openstack.org/python-manilaclient/latest/
Author: OpenStack
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/api_versions.py
new/python-manilaclient-1.21.0/manilaclient/api_versions.py
--- old/python-manilaclient-1.19.0/manilaclient/api_versions.py 2017-12-07
21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/api_versions.py 2018-01-26
01:31:54.000000000 +0100
@@ -27,7 +27,7 @@
LOG = logging.getLogger(__name__)
-MAX_VERSION = '2.40'
+MAX_VERSION = '2.42'
MIN_VERSION = '2.0'
DEPRECATED_VERSION = '1.0'
_VERSIONED_METHOD_MAP = {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/manilaclient/base.py
new/python-manilaclient-1.21.0/manilaclient/base.py
--- old/python-manilaclient-1.19.0/manilaclient/base.py 2017-12-07
21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/base.py 2018-01-26
01:31:54.000000000 +0100
@@ -74,8 +74,12 @@
with self.completion_cache('human_id', obj_class, mode="w"):
with self.completion_cache('uuid', obj_class, mode="w"):
- return [obj_class(self, res, loaded=True)
- for res in data if res]
+ resource = [obj_class(self, res, loaded=True)
+ for res in data if res]
+ if 'count' in body:
+ return resource, body['count']
+ else:
+ return resource
@contextlib.contextmanager
def completion_cache(self, cache_type, obj_class, mode):
@@ -208,7 +212,8 @@
found = []
searches = list(kwargs.items())
- for obj in self.list():
+ search_opts = {'all_tenants': 1}
+ for obj in self.list(search_opts=search_opts):
try:
if all(getattr(obj, attr) == value
for (attr, value) in searches):
@@ -218,5 +223,5 @@
return found
- def list(self):
+ def list(self, search_opts=None):
raise NotImplementedError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/functional/base.py
new/python-manilaclient-1.21.0/manilaclient/tests/functional/base.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/functional/base.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/functional/base.py
2018-01-26 01:32:21.000000000 +0100
@@ -176,20 +176,24 @@
create_share_from_snapshot=None,
revert_to_snapshot=None, mount_snapshot=None,
is_public=True, client=None, cleanup_in_class=True,
- microversion=None, extra_specs=None):
+ microversion=None, extra_specs=None,
+ description=None):
if client is None:
client = cls.get_admin_client()
- share_type = client.create_share_type(
- name=name,
- driver_handles_share_servers=driver_handles_share_servers,
- snapshot_support=snapshot_support,
- is_public=is_public,
- microversion=microversion,
- extra_specs=extra_specs,
- create_share_from_snapshot=create_share_from_snapshot,
- revert_to_snapshot=revert_to_snapshot,
- mount_snapshot=mount_snapshot,
- )
+ data = {
+ "name": name,
+ "driver_handles_share_servers": driver_handles_share_servers,
+ "snapshot_support": snapshot_support,
+ "is_public": is_public,
+ "microversion": microversion,
+ "extra_specs": extra_specs,
+ "create_share_from_snapshot": create_share_from_snapshot,
+ "revert_to_snapshot": revert_to_snapshot,
+ "mount_snapshot": mount_snapshot,
+ }
+ if description:
+ data["description"] = description
+ share_type = client.create_share_type(**data)
resource = {
"type": "share_type",
"id": share_type["ID"],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/functional/client.py
new/python-manilaclient-1.21.0/manilaclient/tests/functional/client.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/functional/client.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/functional/client.py
2018-01-26 01:32:21.000000000 +0100
@@ -170,11 +170,14 @@
snapshot_support=None,
create_share_from_snapshot=None,
revert_to_snapshot=None, mount_snapshot=None,
- is_public=True, microversion=None, extra_specs=None):
+ is_public=True, microversion=None, extra_specs=None,
+ description=None):
"""Creates share type.
:param name: text -- name of share type to use, if not set then
autogenerated will be used
+ :param description: text -- description of share type to use.
+ Default is None.
:param driver_handles_share_servers: bool/str -- boolean or its
string alias. Default is True.
:param snapshot_support: bool/str -- boolean or its
@@ -199,6 +202,9 @@
cmd = ('type-create %(name)s %(dhss)s --is-public %(is_public)s ') % {
'name': name, 'dhss': dhss, 'is_public': is_public}
+ if description is not None:
+ cmd += " --description " + description
+
if snapshot_support is not None:
if not isinstance(snapshot_support, six.string_types):
snapshot_support = six.text_type(snapshot_support)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_share_access.py
new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_share_access.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_share_access.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_share_access.py
2018-01-26 01:31:54.000000000 +0100
@@ -217,6 +217,16 @@
access_level = 'ro'
+class MAPRFSShareRWAccessReadWriteTest(ShareAccessReadWriteBase):
+ protocol = 'maprfs'
+ access_level = 'rw'
+
+
+class MAPRFSShareROAccessReadWriteTest(ShareAccessReadWriteBase):
+ protocol = 'maprfs'
+ access_level = 'ro'
+
+
def load_tests(loader, tests, _):
result = []
for test_case in tests:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_share_types.py
new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_share_types.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_share_types.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_share_types.py
2018-01-26 01:32:21.000000000 +0100
@@ -116,12 +116,19 @@
spec_create_share_from_snapshot, spec_revert_to_snapshot_support,
None, extra_specs)
+ def test_create_delete_share_type_with_description(self):
+ self.skip_if_microversion_not_supported('2.41')
+ self._test_create_delete_share_type(
+ '2.41', True, False, None, None, None, None, None,
+ description=data_utils.rand_name('test_share_type_description'))
+
def _test_create_delete_share_type(self, microversion, is_public, dhss,
spec_snapshot_support,
spec_create_share_from_snapshot,
spec_revert_to_snapshot_support,
spec_mount_snapshot_support,
- extra_specs):
+ extra_specs,
+ description=None):
share_type_name = data_utils.rand_name('manilaclient_functional_test')
@@ -138,7 +145,8 @@
mount_snapshot=spec_mount_snapshot_support,
is_public=is_public,
microversion=microversion,
- extra_specs=extra_specs)
+ extra_specs=extra_specs,
+ description=description)
# Verify response body
for key in self.create_keys:
@@ -147,6 +155,13 @@
# Verify type name
self.assertEqual(share_type_name, share_type['Name'])
+ # Verify type description
+ if (api_versions.APIVersion(microversion) >=
+ api_versions.APIVersion('2.41')):
+ self.assertEqual(description, share_type['Description'])
+ else:
+ self.assertNotIn('description', share_type)
+
# Verify required DHSS extra spec
dhss_expected = 'driver_handles_share_servers : %s' % dhss
self.assertEqual(dhss_expected, share_type['required_extra_specs'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_shares.py
new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_shares.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_shares.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_shares.py
2018-01-26 01:31:54.000000000 +0100
@@ -227,3 +227,7 @@
class HDFSSharesReadWriteTest(SharesReadWriteBase):
protocol = 'hdfs'
+
+
+class MAPRFSSharesReadWriteTest(SharesReadWriteBase):
+ protocol = 'maprfs'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_snapshot_access.py
new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_snapshot_access.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/functional/test_snapshot_access.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/functional/test_snapshot_access.py
2018-01-26 01:31:54.000000000 +0100
@@ -162,6 +162,10 @@
protocol = 'hdfs'
+class MAPRFSSnapshotAccessTest(SnapshotAccessReadBase):
+ protocol = 'maprfs'
+
+
def load_tests(loader, tests, _):
result = []
for test_case in tests:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/test_base.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/test_base.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/unit/test_base.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/unit/test_base.py
2018-01-26 01:31:54.000000000 +0100
@@ -9,6 +9,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+from mock import mock
from manilaclient.common.apiclient import base as common_base
from manilaclient import exceptions
@@ -60,3 +61,8 @@
self.assertRaises(exceptions.NotFound,
cs.shares.find,
vegetable='carrot')
+
+ def test_findall_with_all_tenants(self):
+ cs.shares.list = mock.Mock(return_value=[])
+ cs.shares.findall()
+ cs.shares.list.assert_called_once_with(search_opts={'all_tenants': 1})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/fakes.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/fakes.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/fakes.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/fakes.py
2018-01-26 01:32:21.000000000 +0100
@@ -233,7 +233,8 @@
"rel": "self"},
],
},
- ]
+ ],
+ 'count': 2,
}
return (200, {}, shares)
@@ -830,6 +831,13 @@
def get_types_default(self, **kw):
return self.get_types_1(**kw)
+ def get_types_1234(self, **kw):
+ return (200, {}, {
+ 'share_type': {'id': 1,
+ 'name': 'test-type-1',
+ 'extra_specs': {'test': 'test'},
+ 'required_extra_specs': {'test': 'test'}}})
+
def get_types(self, **kw):
return (200, {}, {
'share_types': [{'id': 1,
@@ -885,6 +893,7 @@
'share_type': {
'id': 3,
'name': 'test-type-3',
+ 'description': 'test description',
'extra_specs': share_type['extra_specs'],
'required_extra_specs': required_extra_specs,
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_export_locations.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -42,7 +42,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_group_type_access.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_group_type_access.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_group_type_access.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_group_type_access.py
2018-01-26 01:31:54.000000000 +0100
@@ -58,7 +58,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_group_types.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_group_types.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_group_types.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_group_types.py
2018-01-26 01:31:54.000000000 +0100
@@ -188,7 +188,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_instance_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_instance_export_locations.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_instance_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_instance_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -43,7 +43,8 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_instances.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_instances.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_instances.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_instances.py
2018-01-26 01:31:54.000000000 +0100
@@ -38,7 +38,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_replicas.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_replicas.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_replicas.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_replicas.py
2018-01-26 01:31:54.000000000 +0100
@@ -95,7 +95,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_snapshot_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -30,7 +30,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_snapshot_instance_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -31,7 +31,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_snapshot_instances.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_snapshot_instances.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_share_snapshot_instances.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_share_snapshot_instances.py
2018-01-26 01:31:54.000000000 +0100
@@ -47,7 +47,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_shares.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_shares.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_shares.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_shares.py
2018-01-26 01:31:54.000000000 +0100
@@ -321,6 +321,16 @@
+ value + '&is_public=True'))
def test_list_shares_detailed(self):
+ search_opts = {
+ 'with_count': 'True',
+ }
+ shares, count = cs.shares.list(detailed=True, search_opts=search_opts)
+ cs.assert_called(
+ 'GET', '/shares/detail?is_public=True&with_count=True')
+ self.assertEqual(2, count)
+ self.assertEqual(1, len(shares))
+
+ def test_list_shares_detailed_with_count(self):
cs.shares.list(detailed=True)
cs.assert_called('GET', '/shares/detail?is_public=True')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_shell.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_shell.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_shell.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_shell.py
2018-01-26 01:32:21.000000000 +0100
@@ -349,7 +349,7 @@
self.run_command,
'list --snapshot not_found_expected',
)
- self.assert_called('GET', '/snapshots/detail')
+ self.assert_called('GET', '/snapshots/detail?all_tenants=1')
def test_list_filter_by_host(self):
for separator in self.separators:
@@ -395,7 +395,26 @@
self.run_command,
'list --share-network not_found_expected',
)
- self.assert_called('GET', '/share-networks/detail')
+ self.assert_called('GET', '/share-networks/detail?all_tenants=1')
+
+ @ddt.data('True', 'False')
+ def test_list_filter_with_count(self, value):
+ except_url = '/shares/detail?with_count=' + value
+ if value == 'False':
+ except_url = '/shares/detail'
+
+ for separator in self.separators:
+ self.run_command('list --count' + separator + value)
+ self.assert_called('GET', except_url)
+
+ @ddt.data('True', 'False')
+ def test_list_filter_with_count_invalid_version(self, value):
+ self.assertRaises(
+ exceptions.CommandError,
+ self.run_command,
+ 'list --count ' + value,
+ version='2.41'
+ )
@mock.patch.object(cliutils, 'print_list', mock.Mock())
def test_share_instance_list(self):
@@ -484,6 +503,10 @@
self.run_command('share-instance-force-delete 1234')
manager_mock.force_delete.assert_called_once_with(share_instance)
+ def test_type_show_details(self):
+ self.run_command('type-show 1234')
+ self.assert_called_anytime('GET', '/types/1234')
+
@mock.patch.object(cliutils, 'print_list', mock.Mock())
def test_type_list(self):
self.run_command('type-list')
@@ -492,7 +515,7 @@
cliutils.print_list.assert_called_once_with(
mock.ANY,
['ID', 'Name', 'visibility', 'is_default', 'required_extra_specs',
- 'optional_extra_specs'],
+ 'optional_extra_specs', 'Description'],
mock.ANY)
@mock.patch.object(cliutils, 'print_list', mock.Mock())
@@ -938,6 +961,31 @@
self.assert_called('POST', '/types', body=expected)
+ def test_type_create_with_description(self):
+ expected = {
+ "share_type": {
+ "name": "test",
+ "description": "test_description",
+ "share_type_access:is_public": True,
+ "extra_specs": {
+ "driver_handles_share_servers": False,
+ }
+ }
+ }
+ self.run_command('type-create test false '
+ '--description test_description', version='2.41')
+
+ self.assert_called('POST', '/types', body=expected)
+
+ @ddt.data('2.26', '2.40')
+ def test_type_create_invalid_description_version(self, version):
+ self.assertRaises(
+ exceptions.CommandError,
+ self.run_command,
+ 'type-create test false --description test_description',
+ version=version
+ )
+
@ddt.unpack
@ddt.data(
*([{'expected_bool': True, 'text': v}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_type_access.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_type_access.py
---
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_type_access.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_type_access.py
2018-01-26 01:31:54.000000000 +0100
@@ -49,7 +49,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_types.py
new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_types.py
--- old/python-manilaclient-1.19.0/manilaclient/tests/unit/v2/test_types.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/tests/unit/v2/test_types.py
2018-01-26 01:32:21.000000000 +0100
@@ -364,9 +364,11 @@
("2.6", True),
("2.7", True),
("2.24", True),
+ ("2.41", True),
("2.6", False),
("2.7", False),
("2.24", False),
+ ("2.41", False),
)
@ddt.unpack
def test_create_with_default_values(self, microversion, dhss):
@@ -374,7 +376,13 @@
manager = self._get_share_types_manager(microversion)
self.mock_object(manager, '_create', mock.Mock(return_value="fake"))
- result = manager.create('test-type-3', dhss)
+ description = 'test description'
+ if (api_versions.APIVersion(microversion) >=
+ api_versions.APIVersion("2.41")):
+ result = manager.create(
+ 'test-type-3', dhss, description=description)
+ else:
+ result = manager.create('test-type-3', dhss)
if (api_versions.APIVersion(microversion) >
api_versions.APIVersion("2.6")):
@@ -397,6 +405,9 @@
api_versions.APIVersion("2.24")):
del expected_body['share_type']['extra_specs']['snapshot_support']
+ if (api_versions.APIVersion(microversion) >=
+ api_versions.APIVersion("2.41")):
+ expected_body['share_type']['description'] = description
manager._create.assert_called_once_with(
"/types", expected_body, "share_type")
self.assertEqual("fake", result)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_export_locations.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -33,7 +33,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_group_type_access.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_group_type_access.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_group_type_access.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_group_type_access.py
2018-01-26 01:31:54.000000000 +0100
@@ -34,7 +34,7 @@
@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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_group_types.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_group_types.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_group_types.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_group_types.py
2018-01-26 01:31:54.000000000 +0100
@@ -131,7 +131,7 @@
@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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_instance_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_instance_export_locations.py
---
old/python-manilaclient-1.19.0/manilaclient/v2/share_instance_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/v2/share_instance_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -33,7 +33,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_instances.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_instances.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_instances.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_instances.py
2018-01-26 01:31:54.000000000 +0100
@@ -49,12 +49,12 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_replicas.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_replicas.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_replicas.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_replicas.py
2018-01-26 01:31:54.000000000 +0100
@@ -63,10 +63,11 @@
@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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_snapshot_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_snapshot_export_locations.py
---
old/python-manilaclient-1.19.0/manilaclient/v2/share_snapshot_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/v2/share_snapshot_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -38,7 +38,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_snapshot_instance_export_locations.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_snapshot_instance_export_locations.py
---
old/python-manilaclient-1.19.0/manilaclient/v2/share_snapshot_instance_export_locations.py
2017-12-07 21:32:56.000000000 +0100
+++
new/python-manilaclient-1.21.0/manilaclient/v2/share_snapshot_instance_export_locations.py
2018-01-26 01:31:54.000000000 +0100
@@ -38,7 +38,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_snapshot_instances.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_snapshot_instances.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_snapshot_instances.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_snapshot_instances.py
2018-01-26 01:31:54.000000000 +0100
@@ -45,7 +45,7 @@
"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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_type_access.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_type_access.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_type_access.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_type_access.py
2018-01-26 01:31:54.000000000 +0100
@@ -40,11 +40,11 @@
"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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/manilaclient/v2/share_types.py
new/python-manilaclient-1.21.0/manilaclient/v2/share_types.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/share_types.py
2017-12-07 21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/share_types.py
2018-01-26 01:32:21.000000000 +0100
@@ -117,6 +117,15 @@
query_string = '?is_public=all'
return self._list("/types%s" % query_string, "share_types")
+ def show(self, share_type):
+ """Get a share.
+
+ :param share: either share object or text with its ID.
+ :rtype: :class:`Share`
+ """
+ type_id = common_base.getid(share_type)
+ return self._get("/types/%s" % type_id, "share_type")
+
def get(self, share_type="default"):
"""Get a specific share type.
@@ -134,7 +143,8 @@
self._delete("/types/%s" % common_base.getid(share_type))
def _do_create(self, name, extra_specs, is_public,
- is_public_keyname="share_type_access:is_public"):
+ is_public_keyname="share_type_access:is_public",
+ description=None):
"""Create a share type.
:param name: Descriptive name of the share type
@@ -148,6 +158,9 @@
"extra_specs": extra_specs,
}
}
+
+ if description:
+ body["share_type"]["description"] = description
return self._create("/types", body, "share_type")
@api_versions.wraps("1.0", "2.6")
@@ -180,7 +193,7 @@
return self._do_create(name, extra_specs, is_public)
- @api_versions.wraps("2.24") # noqa
+ @api_versions.wraps("2.24", "2.40") # noqa
def create(self, name, spec_driver_handles_share_servers,
spec_snapshot_support=None, is_public=True, extra_specs=None):
@@ -193,6 +206,20 @@
return self._do_create(name, extra_specs, is_public)
+ @api_versions.wraps("2.41") # noqa
+ def create(self, name, spec_driver_handles_share_servers,
+ spec_snapshot_support=None, is_public=True, extra_specs=None,
+ description=None):
+ if extra_specs is None:
+ extra_specs = {}
+
+ self._handle_spec_driver_handles_share_servers(
+ extra_specs, spec_driver_handles_share_servers)
+ self._handle_spec_snapshot_support(extra_specs, spec_snapshot_support)
+
+ return self._do_create(name, extra_specs, is_public,
+ description=description)
+
def _handle_spec_driver_handles_share_servers(
self, extra_specs, spec_driver_handles_share_servers):
"""Validation and default for DHSS extra spec."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/manilaclient/v2/shell.py
new/python-manilaclient-1.21.0/manilaclient/v2/shell.py
--- old/python-manilaclient-1.19.0/manilaclient/v2/shell.py 2017-12-07
21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/manilaclient/v2/shell.py 2018-01-26
01:32:21.000000000 +0100
@@ -151,6 +151,21 @@
return apiclient_utils.find_resource(cs.share_instances, instance)
+def _print_type_show(stype, default_share_type=None):
+
+ is_default = 'YES' if stype == default_share_type else 'NO'
+ stype_dict = {
+ 'id': stype.id,
+ 'name': stype.name,
+ 'visibility': _is_share_type_public(stype),
+ 'is_default': is_default,
+ 'description': None,
+ 'required_extra_specs': _print_type_required_extra_specs(stype),
+ 'optional_extra_specs': _print_type_optional_extra_specs(stype),
+ }
+ cliutils.print_dict(stype_dict)
+
+
@api_versions.wraps("1.0", "2.8")
def _print_share_instance(cs, instance):
info = instance._info.copy()
@@ -1627,6 +1642,14 @@
action='single_alias',
help='ID or path of the share export location. '
'Available only for microversion >= 2.35.')
[email protected](
+ '--count',
+ dest='count',
+ metavar='<True|False>',
+ choices=['True', 'False'],
+ default=False,
+ help='Display total number of shares to return. '
+ 'Available only for microversion >= 2.42.')
@cliutils.service_type('sharev2')
def do_list(cs, args):
"""List NAS shares with filters."""
@@ -1692,14 +1715,28 @@
"Filtering by export location is only "
"available with manila API version >= 2.35")
+ if (args.count and
+ cs.api_version.matches(
+ api_versions.APIVersion(), api_versions.APIVersion("2.41"))):
+ raise exceptions.CommandError(
+ "Display total number of shares is only "
+ "available with manila API version >= 2.42")
+
if share_group:
search_opts['share_group_id'] = share_group.id
- shares = cs.shares.list(
- search_opts=search_opts,
- sort_key=args.sort_key,
- sort_dir=args.sort_dir,
- )
+ total_count = 0
+ if strutils.bool_from_string(args.count, strict=True):
+ search_opts['with_count'] = args.count
+ shares, total_count = cs.shares.list(
+ search_opts=search_opts, sort_key=args.sort_key,
+ sort_dir=args.sort_dir,
+ )
+ else:
+ shares = cs.shares.list(
+ search_opts=search_opts, sort_key=args.sort_key,
+ sort_dir=args.sort_dir,
+ )
# NOTE(vponomaryov): usage of 'export_location' and
# 'export_locations' columns may cause scaling issue using API 2.9+ and
# when lots of shares are returned.
@@ -1712,6 +1749,8 @@
setattr(share, 'export_locations', els)
setattr(share, 'export_location', els[0] if els else None)
cliutils.print_list(shares, list_of_keys)
+ if args.count:
+ print("Shares in total: %s" % total_count)
@cliutils.arg(
@@ -3554,7 +3593,8 @@
return 'public' if share_type.is_public else 'private'
-def _print_share_type_list(stypes, default_share_type=None, columns=None):
+def _print_share_type_list(stypes, default_share_type=None, columns=None,
+ description=False):
def _is_default(share_type):
if share_type == default_share_type:
@@ -3581,13 +3621,15 @@
'required_extra_specs',
'optional_extra_specs',
]
+ if description:
+ fields.append('Description')
if columns is not None:
fields = _split_columns(columns=columns, title=False)
cliutils.print_list(stypes, fields, formatters)
-def _print_share_type(stype, default_share_type=None):
+def _print_share_type(stype, default_share_type=None, show_des=False):
def _is_default(share_type):
if share_type == default_share_type:
@@ -3603,6 +3645,8 @@
'required_extra_specs': _print_type_required_extra_specs(stype),
'optional_extra_specs': _print_type_optional_extra_specs(stype),
}
+ if show_des:
+ stype_dict['Description'] = stype.description
cliutils.print_dict(stype_dict)
@@ -3645,8 +3689,24 @@
default = None
stypes = cs.share_types.list(show_all=args.all)
+ show_des = cs.api_version.matches(
+ api_versions.APIVersion("2.41"), api_versions.APIVersion())
_print_share_type_list(stypes, default_share_type=default,
- columns=args.columns)
+ columns=args.columns, description=show_des)
+
+
[email protected](
+ 'share_type',
+ metavar='<share_type>',
+ help='Name or ID of the share type.')
+def do_type_show(cs, args):
+ """Show share type details."""
+ share_type = cs.share_types.show(args.share_type)
+ try:
+ default = cs.share_types.get()
+ except exceptions.NotFound:
+ default = None
+ _print_type_show(share_type, default_share_type=default)
@cliutils.arg(
@@ -3673,6 +3733,13 @@
help="Required extra specification. "
"Valid values are 'true'/'1' and 'false'/'0'.")
@cliutils.arg(
+ '--description',
+ metavar='<description>',
+ type=str,
+ default=None,
+ help='Filter results by description. '
+ 'Available only for microversion >= 2.41.')
[email protected](
'--snapshot_support',
'--snapshot-support',
metavar='<snapshot_support>',
@@ -3740,6 +3807,16 @@
"set via positional argument.")
raise exceptions.CommandError(msg)
+ show_des = False
+ if cs.api_version.matches(api_versions.APIVersion("2.41"),
+ api_versions.APIVersion()):
+ show_des = True
+ kwargs['description'] = getattr(args, 'description')
+ elif getattr(args, 'description'):
+ raise exceptions.CommandError(
+ "Pattern based option (description)"
+ " is only available with manila API version >= 2.41")
+
boolean_keys = (
'snapshot_support',
'create_share_from_snapshot_support',
@@ -3767,7 +3844,7 @@
raise exceptions.CommandError(msg)
stype = cs.share_types.create(**kwargs)
- _print_share_type(stype)
+ _print_share_type(stype, show_des=show_des)
@cliutils.arg(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/python_manilaclient.egg-info/PKG-INFO
new/python-manilaclient-1.21.0/python_manilaclient.egg-info/PKG-INFO
--- old/python-manilaclient-1.19.0/python_manilaclient.egg-info/PKG-INFO
2017-12-07 21:35:35.000000000 +0100
+++ new/python-manilaclient-1.21.0/python_manilaclient.egg-info/PKG-INFO
2018-01-26 01:35:28.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-manilaclient
-Version: 1.19.0
+Version: 1.21.0
Summary: Client library for OpenStack Manila API.
Home-page: https://docs.openstack.org/python-manilaclient/latest/
Author: OpenStack
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/python_manilaclient.egg-info/SOURCES.txt
new/python-manilaclient-1.21.0/python_manilaclient.egg-info/SOURCES.txt
--- old/python-manilaclient-1.19.0/python_manilaclient.egg-info/SOURCES.txt
2017-12-07 21:35:37.000000000 +0100
+++ new/python-manilaclient-1.21.0/python_manilaclient.egg-info/SOURCES.txt
2018-01-26 01:35:29.000000000 +0100
@@ -186,6 +186,7 @@
rally-jobs/rally-manila-no-ss.yaml
rally-jobs/rally-manila.yaml
releasenotes/notes/.placeholder
+releasenotes/notes/add-count-info-in-share-21a6b36c0f4c87b2.yaml
releasenotes/notes/add-export-location-filter-4cf3114doe40k598.yaml
releasenotes/notes/add-ipv6-access-type-4dko90r1a9a1e0b8.yaml
releasenotes/notes/add-like-filter-591572762357ef4b.yaml
@@ -206,6 +207,8 @@
releasenotes/notes/bug-1682726-remove-sort-key-export-location-from-list-885des26bd5ea2de.yaml
releasenotes/notes/bug-1707303-fix-list-command-when-not-given-search-opts-c06af7b344e9cb91.yaml
releasenotes/notes/bug-1709746-add-group-specs-in-share-group-type-create-command-f91265de5c2f251b.yaml
+releasenotes/notes/bug-1724183-add-share-type-description-8c4b26f44b5da1e9.yaml
+releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml
releasenotes/notes/bug-share-access-list-3cf3114doe40k599.yaml
releasenotes/notes/bug_1570085_fix-905786b797379309.yaml
releasenotes/notes/bug_1603387_fix_env_variable_8ed5450aab41aa5f.yaml
@@ -222,6 +225,7 @@
releasenotes/notes/share-revert-to-snapshot-e899a4b7e1126749.yaml
releasenotes/notes/start-using-reno-b744cd0259c7a88c.yaml
releasenotes/notes/support-create-share-from-snapshot-extra-spec-cdba92f179c1c5c6.yaml
+releasenotes/notes/support-show-type-6380b7c539c95ba8.yaml
releasenotes/notes/type-create-extra-specs-691572762357ef3b.yaml
releasenotes/source/conf.py
releasenotes/source/index.rst
@@ -234,5 +238,4 @@
tools/generate_authors.sh
tools/install_venv.py
tools/manila.bash_completion
-tools/tox_install.sh
tools/with_venv.sh
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/python_manilaclient.egg-info/pbr.json
new/python-manilaclient-1.21.0/python_manilaclient.egg-info/pbr.json
--- old/python-manilaclient-1.19.0/python_manilaclient.egg-info/pbr.json
2017-12-07 21:35:35.000000000 +0100
+++ new/python-manilaclient-1.21.0/python_manilaclient.egg-info/pbr.json
2018-01-26 01:35:28.000000000 +0100
@@ -1 +1 @@
-{"git_version": "d4c581d", "is_release": true}
\ No newline at end of file
+{"git_version": "27c189f", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/python_manilaclient.egg-info/requires.txt
new/python-manilaclient-1.21.0/python_manilaclient.egg-info/requires.txt
--- old/python-manilaclient-1.19.0/python_manilaclient.egg-info/requires.txt
2017-12-07 21:35:35.000000000 +0100
+++ new/python-manilaclient-1.21.0/python_manilaclient.egg-info/requires.txt
2018-01-26 01:35:28.000000000 +0100
@@ -3,7 +3,7 @@
oslo.config>=5.1.0
oslo.log>=3.30.0
oslo.serialization!=2.19.1,>=2.18.0
-oslo.utils>=3.31.0
+oslo.utils>=3.33.0
PrettyTable<0.8,>=0.7.1
requests>=2.14.2
simplejson>=3.5.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/releasenotes/notes/add-count-info-in-share-21a6b36c0f4c87b2.yaml
new/python-manilaclient-1.21.0/releasenotes/notes/add-count-info-in-share-21a6b36c0f4c87b2.yaml
---
old/python-manilaclient-1.19.0/releasenotes/notes/add-count-info-in-share-21a6b36c0f4c87b2.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/python-manilaclient-1.21.0/releasenotes/notes/add-count-info-in-share-21a6b36c0f4c87b2.yaml
2018-01-26 01:31:54.000000000 +0100
@@ -0,0 +1,3 @@
+---
+features:
+ - Added ``with_count`` option in share's list commands since 2.42.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/releasenotes/notes/bug-1724183-add-share-type-description-8c4b26f44b5da1e9.yaml
new/python-manilaclient-1.21.0/releasenotes/notes/bug-1724183-add-share-type-description-8c4b26f44b5da1e9.yaml
---
old/python-manilaclient-1.19.0/releasenotes/notes/bug-1724183-add-share-type-description-8c4b26f44b5da1e9.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/python-manilaclient-1.21.0/releasenotes/notes/bug-1724183-add-share-type-description-8c4b26f44b5da1e9.yaml
2018-01-26 01:32:21.000000000 +0100
@@ -0,0 +1,3 @@
+---
+fixes:
+ - Added description in list/create share type CLI.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml
new/python-manilaclient-1.21.0/releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml
---
old/python-manilaclient-1.19.0/releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/python-manilaclient-1.21.0/releasenotes/notes/bug-1738917-and-1738918-fix-access-share-group-type-by-name-3a8760522c147f28.yaml
2018-01-26 01:31:54.000000000 +0100
@@ -0,0 +1,4 @@
+---
+fixes:
+ - Fixed bugs 1738917 and 1738918. Names can now be used in commands
+ pertaining to share group types.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-manilaclient-1.19.0/releasenotes/notes/support-show-type-6380b7c539c95ba8.yaml
new/python-manilaclient-1.21.0/releasenotes/notes/support-show-type-6380b7c539c95ba8.yaml
---
old/python-manilaclient-1.19.0/releasenotes/notes/support-show-type-6380b7c539c95ba8.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/python-manilaclient-1.21.0/releasenotes/notes/support-show-type-6380b7c539c95ba8.yaml
2018-01-26 01:32:21.000000000 +0100
@@ -0,0 +1,3 @@
+---
+features:
+ - Support show type details command.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/requirements.txt
new/python-manilaclient-1.21.0/requirements.txt
--- old/python-manilaclient-1.19.0/requirements.txt 2017-12-07
21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/requirements.txt 2018-01-26
01:31:54.000000000 +0100
@@ -9,7 +9,7 @@
oslo.config>=5.1.0 # Apache-2.0
oslo.log>=3.30.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
-oslo.utils>=3.31.0 # Apache-2.0
+oslo.utils>=3.33.0 # Apache-2.0
PrettyTable<0.8,>=0.7.1 # BSD
requests>=2.14.2 # Apache-2.0
simplejson>=3.5.1 # MIT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/tools/tox_install.sh
new/python-manilaclient-1.21.0/tools/tox_install.sh
--- old/python-manilaclient-1.19.0/tools/tox_install.sh 2017-12-07
21:32:56.000000000 +0100
+++ new/python-manilaclient-1.21.0/tools/tox_install.sh 1970-01-01
01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-#!/usr/bin/env bash
-
-# Client constraint file contains this client version pin that is in conflict
-# with installing the client from source. We should remove the version pin in
-# the constraints file before applying it for from-source installation.
-
-CONSTRAINTS_FILE="$1"
-shift 1
-
-set -e
-
-# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
-# published to logs.openstack.org for easy debugging.
-localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
-
-if [[ "$CONSTRAINTS_FILE" != http* ]]; then
- CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
-fi
-# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
-curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
-
-pip install -c"$localfile" openstack-requirements
-
-# This is the main purpose of the script: Allow local installation of
-# the current repo. It is listed in constraints file and thus any
-# install will be constrained and we need to unconstrain it.
-edit-constraints "$localfile" -- "$CLIENT_NAME"
-
-pip install -c"$localfile" -U "$@"
-exit $?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-manilaclient-1.19.0/tox.ini
new/python-manilaclient-1.21.0/tox.ini
--- old/python-manilaclient-1.19.0/tox.ini 2017-12-07 21:32:56.000000000
+0100
+++ new/python-manilaclient-1.21.0/tox.ini 2018-01-26 01:31:54.000000000
+0100
@@ -5,16 +5,16 @@
skipsdist = True
[testenv]
-install_command = {toxinidir}/tools/tox_install.sh
{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
{opts} {packages}
+install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
- BRANCH_NAME=master
- CLIENT_NAME=python-manilaclient
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
whitelist_externals = find
-deps = -r{toxinidir}/requirements.txt
+deps =
+
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
+ -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete