python-manilaclient 5.2.0__py3-none-any.whl → 5.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- manilaclient/api_versions.py +1 -1
- manilaclient/osc/v2/share_access_rules.py +33 -8
- manilaclient/tests/functional/osc/test_share_access_rules.py +19 -1
- manilaclient/tests/unit/osc/v2/test_share_access_rules.py +18 -1
- manilaclient/v2/share_access_rules.py +18 -2
- {python_manilaclient-5.2.0.dist-info → python_manilaclient-5.3.0.dist-info}/METADATA +13 -16
- {python_manilaclient-5.2.0.dist-info → python_manilaclient-5.3.0.dist-info}/RECORD +13 -13
- {python_manilaclient-5.2.0.dist-info → python_manilaclient-5.3.0.dist-info}/WHEEL +1 -1
- {python_manilaclient-5.2.0.dist-info → python_manilaclient-5.3.0.dist-info}/entry_points.txt +0 -1
- python_manilaclient-5.3.0.dist-info/pbr.json +1 -0
- python_manilaclient-5.2.0.dist-info/pbr.json +0 -1
- {python_manilaclient-5.2.0.dist-info → python_manilaclient-5.3.0.dist-info}/AUTHORS +0 -0
- {python_manilaclient-5.2.0.dist-info → python_manilaclient-5.3.0.dist-info}/LICENSE +0 -0
- {python_manilaclient-5.2.0.dist-info → python_manilaclient-5.3.0.dist-info}/top_level.txt +0 -0
manilaclient/api_versions.py
CHANGED
|
@@ -417,15 +417,35 @@ class SetShareAccess(command.Command):
|
|
|
417
417
|
'(Repeat option to set multiple properties) '
|
|
418
418
|
'Available only for API microversion >= 2.45.'),
|
|
419
419
|
)
|
|
420
|
+
parser.add_argument(
|
|
421
|
+
"--access-level",
|
|
422
|
+
metavar="<access_level>",
|
|
423
|
+
default=None,
|
|
424
|
+
choices=['rw', 'ro'],
|
|
425
|
+
help=_('Share access level ("rw" and "ro" access levels '
|
|
426
|
+
'are supported) to set.')
|
|
427
|
+
)
|
|
420
428
|
return parser
|
|
421
429
|
|
|
422
430
|
def take_action(self, parsed_args):
|
|
423
431
|
share_client = self.app.client_manager.share
|
|
424
432
|
|
|
425
|
-
if
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
433
|
+
if (parsed_args.property and
|
|
434
|
+
share_client.api_version < api_versions.APIVersion("2.45")):
|
|
435
|
+
raise exceptions.CommandError(
|
|
436
|
+
"Setting properties to access rule is supported only "
|
|
437
|
+
"with API microversion 2.45 and higher")
|
|
438
|
+
|
|
439
|
+
if (parsed_args.access_level and
|
|
440
|
+
share_client.api_version < api_versions.APIVersion("2.88")):
|
|
441
|
+
raise exceptions.CommandError(
|
|
442
|
+
"Setting access level to access rule is supported only "
|
|
443
|
+
"with API microversion 2.88 and higher")
|
|
444
|
+
|
|
445
|
+
access_rule = share_client.share_access_rules.get(
|
|
446
|
+
parsed_args.access_id
|
|
447
|
+
)
|
|
448
|
+
if parsed_args.property:
|
|
429
449
|
try:
|
|
430
450
|
share_client.share_access_rules.set_metadata(
|
|
431
451
|
access_rule,
|
|
@@ -435,10 +455,15 @@ class SetShareAccess(command.Command):
|
|
|
435
455
|
"Failed to set properties to share access rule with ID "
|
|
436
456
|
"'%s': %s" % (access_rule.id, e))
|
|
437
457
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
458
|
+
if parsed_args.access_level:
|
|
459
|
+
try:
|
|
460
|
+
share_client.share_access_rules.set_access_level(
|
|
461
|
+
access_rule,
|
|
462
|
+
parsed_args.access_level)
|
|
463
|
+
except Exception as e:
|
|
464
|
+
raise exceptions.CommandError(
|
|
465
|
+
"Failed to set access level to share access rule with ID "
|
|
466
|
+
"'%s': %s" % (access_rule.id, e))
|
|
442
467
|
|
|
443
468
|
|
|
444
469
|
class UnsetShareAccess(command.Command):
|
|
@@ -218,7 +218,7 @@ class ShowShareAccessRulesTestCase(base.OSCClientTestBase):
|
|
|
218
218
|
|
|
219
219
|
|
|
220
220
|
class SetShareAccessTestCase(base.OSCClientTestBase):
|
|
221
|
-
def
|
|
221
|
+
def test_set_share_access_metadata(self):
|
|
222
222
|
share = self.create_share()
|
|
223
223
|
access_rule = self.create_share_access_rule(
|
|
224
224
|
share=share['name'],
|
|
@@ -237,6 +237,24 @@ class SetShareAccessTestCase(base.OSCClientTestBase):
|
|
|
237
237
|
f'access show {access_rule["id"]}')
|
|
238
238
|
self.assertEqual(access_rule['properties'], 'foo : bar')
|
|
239
239
|
|
|
240
|
+
def test_set_share_access_level(self):
|
|
241
|
+
share = self.create_share()
|
|
242
|
+
access_rule = self.create_share_access_rule(
|
|
243
|
+
share=share['name'],
|
|
244
|
+
access_type='ip',
|
|
245
|
+
access_to='0.0.0.0/0',
|
|
246
|
+
wait=True)
|
|
247
|
+
|
|
248
|
+
self.assertEqual(access_rule['access_level'], 'rw')
|
|
249
|
+
|
|
250
|
+
self.openstack('share',
|
|
251
|
+
params=f'access set {access_rule["id"]} '
|
|
252
|
+
f'--access-level ro')
|
|
253
|
+
access_rule = self.dict_result(
|
|
254
|
+
'share',
|
|
255
|
+
f'access show {access_rule["id"]}')
|
|
256
|
+
self.assertEqual(access_rule['access_level'], 'ro')
|
|
257
|
+
|
|
240
258
|
|
|
241
259
|
class UnsetShareAccessRulesTestCase(base.OSCClientTestBase):
|
|
242
260
|
def test_unset_share_access(self):
|
|
@@ -548,7 +548,7 @@ class TestShareAccessSet(TestShareAccess):
|
|
|
548
548
|
# Get the command object to test
|
|
549
549
|
self.cmd = osc_share_access_rules.SetShareAccess(self.app, None)
|
|
550
550
|
|
|
551
|
-
def
|
|
551
|
+
def test_access_rule_set_metadata(self):
|
|
552
552
|
arglist = [
|
|
553
553
|
self.access_rule.id,
|
|
554
554
|
'--property', 'key1=value1'
|
|
@@ -565,6 +565,23 @@ class TestShareAccessSet(TestShareAccess):
|
|
|
565
565
|
{'key1': 'value1'})
|
|
566
566
|
self.assertIsNone(result)
|
|
567
567
|
|
|
568
|
+
def test_access_rule_set_access_level(self):
|
|
569
|
+
arglist = [
|
|
570
|
+
self.access_rule.id,
|
|
571
|
+
'--access-level', 'ro'
|
|
572
|
+
]
|
|
573
|
+
verifylist = [
|
|
574
|
+
("access_id", self.access_rule.id),
|
|
575
|
+
('access_level', 'ro')
|
|
576
|
+
]
|
|
577
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
578
|
+
result = self.cmd.take_action(parsed_args)
|
|
579
|
+
|
|
580
|
+
self.access_rules_mock.set_access_level.assert_called_with(
|
|
581
|
+
self.access_rule,
|
|
582
|
+
'ro')
|
|
583
|
+
self.assertIsNone(result)
|
|
584
|
+
|
|
568
585
|
|
|
569
586
|
class TestShareAccessUnset(TestShareAccess):
|
|
570
587
|
|
|
@@ -60,8 +60,7 @@ class ShareAccessRuleManager(base.ManagerWithFind):
|
|
|
60
60
|
def set_metadata(self, access, metadata):
|
|
61
61
|
"""Set or update metadata for share access rule.
|
|
62
62
|
|
|
63
|
-
:param
|
|
64
|
-
text with its ID.
|
|
63
|
+
:param access: either share access rule object or text with its ID.
|
|
65
64
|
:param metadata: A list of keys to be set.
|
|
66
65
|
"""
|
|
67
66
|
body = {'metadata': metadata}
|
|
@@ -73,6 +72,7 @@ class ShareAccessRuleManager(base.ManagerWithFind):
|
|
|
73
72
|
def unset_metadata(self, access, keys):
|
|
74
73
|
"""Unset metadata on a share access rule.
|
|
75
74
|
|
|
75
|
+
:param access: either share access rule object or text with its ID.
|
|
76
76
|
:param keys: A list of keys on this object to be unset
|
|
77
77
|
:return: None if successful, else API response on failure
|
|
78
78
|
"""
|
|
@@ -80,6 +80,22 @@ class ShareAccessRuleManager(base.ManagerWithFind):
|
|
|
80
80
|
url = RESOURCE_METADATA_PATH % (base.getid(access), k)
|
|
81
81
|
self._delete(url)
|
|
82
82
|
|
|
83
|
+
@api_versions.wraps("2.88")
|
|
84
|
+
def set_access_level(self, access, access_level):
|
|
85
|
+
"""Set or update access level for share access rule.
|
|
86
|
+
|
|
87
|
+
:param access: either share access rule object or text with its ID.
|
|
88
|
+
:param access_level: value of access_level (e.g. ro/rw)
|
|
89
|
+
"""
|
|
90
|
+
body = {
|
|
91
|
+
'update_access': {
|
|
92
|
+
'access_level': access_level
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
access_id = base.getid(access)
|
|
96
|
+
url = RESOURCE_PATH % access_id
|
|
97
|
+
return self._update(url, body)
|
|
98
|
+
|
|
83
99
|
@api_versions.wraps("2.45")
|
|
84
100
|
def access_list(self, share, search_opts=None):
|
|
85
101
|
search_opts = search_opts or {}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-manilaclient
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.3.0
|
|
4
4
|
Summary: Client library for OpenStack Manila API.
|
|
5
5
|
Home-page: https://docs.openstack.org/python-manilaclient/latest/
|
|
6
6
|
Author: OpenStack
|
|
7
7
|
Author-email: openstack-discuss@lists.openstack.org
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
9
|
Classifier: Environment :: Console
|
|
12
10
|
Classifier: Environment :: OpenStack
|
|
@@ -22,17 +20,18 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
22
|
Requires-Python: >=3.9
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist: oslo.
|
|
30
|
-
Requires-Dist: oslo.
|
|
31
|
-
Requires-Dist: oslo.
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
License-File: AUTHORS
|
|
25
|
+
Requires-Dist: pbr >=3.0.0
|
|
26
|
+
Requires-Dist: oslo.config >=5.2.0
|
|
27
|
+
Requires-Dist: oslo.log >=3.36.0
|
|
28
|
+
Requires-Dist: oslo.serialization >=2.20.0
|
|
29
|
+
Requires-Dist: oslo.utils >=3.33.0
|
|
30
|
+
Requires-Dist: PrettyTable >=0.7.1
|
|
31
|
+
Requires-Dist: requests >=2.14.2
|
|
32
|
+
Requires-Dist: osc-lib >=1.10.0
|
|
33
|
+
Requires-Dist: python-keystoneclient >=3.8.0
|
|
34
|
+
Requires-Dist: debtcollector >=1.2.0
|
|
36
35
|
|
|
37
36
|
========================
|
|
38
37
|
Team and repository tags
|
|
@@ -142,5 +141,3 @@ Quick-start using keystone::
|
|
|
142
141
|
.. _How to Contribute: https://docs.openstack.org/infra/manual/developers.html
|
|
143
142
|
.. _Release Notes: https://docs.openstack.org/releasenotes/python-manilaclient
|
|
144
143
|
|
|
145
|
-
|
|
146
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
manilaclient/__init__.py,sha256=yLvujNabAf28-BYLBD9MEqkumXr9nfohOAOgvce5qxA,1248
|
|
2
|
-
manilaclient/api_versions.py,sha256=
|
|
2
|
+
manilaclient/api_versions.py,sha256=6J1kBCeV0HD0Q_7zhD87xOTGGv3iOisIr8QFfSYaD-E,15186
|
|
3
3
|
manilaclient/base.py,sha256=5p-7Wjvf4NnsvFi21XWbFhoDzNVt78cK6t6ePyW-PYs,18340
|
|
4
4
|
manilaclient/client.py,sha256=_8GKDn72tiY34X5qLeNYYm5PGucPuusyTBBcFsTgBlI,2387
|
|
5
5
|
manilaclient/config.py,sha256=pyazLQjW3IbblaSX-PtkRnu49E0oADThFXjR0ijIxYE,10524
|
|
@@ -26,7 +26,7 @@ manilaclient/osc/v2/resource_locks.py,sha256=rGsdpkxYA3ZQ4UFTNeq0GDpbb_MZ4b5QJYC
|
|
|
26
26
|
manilaclient/osc/v2/security_services.py,sha256=48ML9X7_4iZTlDIFRI9UmvtpW0J7HOC3jb0Kt6S4Wfg,20321
|
|
27
27
|
manilaclient/osc/v2/services.py,sha256=CNZweoQqbAdoViU2Q00PYK2PKUrt4B253JzqYeA0YbM,6629
|
|
28
28
|
manilaclient/osc/v2/share.py,sha256=LQCFqBwpykk50RFGJpdD_eV8w7BE2duIxN4XLEOY0NQ,58022
|
|
29
|
-
manilaclient/osc/v2/share_access_rules.py,sha256=
|
|
29
|
+
manilaclient/osc/v2/share_access_rules.py,sha256=AA3_XdgcZgRA9s5ehrWfYcixVpZSG51cKpFf4ICtiBc,18927
|
|
30
30
|
manilaclient/osc/v2/share_backups.py,sha256=17yE6Z5NrKzpUNuajSBnlaYZy3YRFQT9_ID-DAq3JL8,14055
|
|
31
31
|
manilaclient/osc/v2/share_group_snapshots.py,sha256=Vkq2vK0K7vaDxKl3TBVm_xMWpJZRfn80JIqusLoFiWY,14824
|
|
32
32
|
manilaclient/osc/v2/share_group_type_access.py,sha256=FDCjx8V8dgAb3TMRvFaPHPURrhq1pT2oupo1qcLD8u0,6315
|
|
@@ -83,7 +83,7 @@ manilaclient/tests/functional/osc/base.py,sha256=-Q23mnx_xzI5KuH6HYA9K42HdVxEnwq
|
|
|
83
83
|
manilaclient/tests/functional/osc/test_availability_zones.py,sha256=qzxGjDWVFjPo257L3hweSIB4RFb0MoS6gdaizqh3Q0o,980
|
|
84
84
|
manilaclient/tests/functional/osc/test_messages.py,sha256=JBN6GnKetb0zmxVqF6_LOtzI70H78iEhK4xUThTazng,4110
|
|
85
85
|
manilaclient/tests/functional/osc/test_resource_locks.py,sha256=P0G5lwywHiISslT4KLMP0vftfc5F2cbIZ5jbp5kChoY,7076
|
|
86
|
-
manilaclient/tests/functional/osc/test_share_access_rules.py,sha256=
|
|
86
|
+
manilaclient/tests/functional/osc/test_share_access_rules.py,sha256=fhN8gGB6PuPBjgKZmDO0MYEzMIR0gE7-lrXBmGZtZdI,9917
|
|
87
87
|
manilaclient/tests/functional/osc/test_share_backups.py,sha256=sWzpdxnz2KKX9BQ6nYFwMUlA74ZLFlmsVwcxciTKM1A,5178
|
|
88
88
|
manilaclient/tests/functional/osc/test_share_group_type_access.py,sha256=hjGjhCpz8N5PJdNY0AQrFX_kZ9PLZgNpElRw7H9mKd4,3533
|
|
89
89
|
manilaclient/tests/functional/osc/test_share_limits.py,sha256=nkQ7gQLTh9bwO-e4eU5WEK5D-IHJqOxQkUNL6BlMLOc,1281
|
|
@@ -122,7 +122,7 @@ manilaclient/tests/unit/osc/v2/test_resource_locks.py,sha256=8PeAVw2PLDSOII3mXzy
|
|
|
122
122
|
manilaclient/tests/unit/osc/v2/test_security_services.py,sha256=dIZGOgWfY3rAul4IyV2jAImxaewAlMQ8jr9ac1NwniQ,22375
|
|
123
123
|
manilaclient/tests/unit/osc/v2/test_services.py,sha256=VOS29A3XPkZ_e3s-Gpl0kaWg1OO0PIyMIjXhJnwWsro,11077
|
|
124
124
|
manilaclient/tests/unit/osc/v2/test_share.py,sha256=_sSqCsZv4oMIHO0yQ7oStc1hpiKVbTPfjSrhpizfawk,74477
|
|
125
|
-
manilaclient/tests/unit/osc/v2/test_share_access_rules.py,sha256=
|
|
125
|
+
manilaclient/tests/unit/osc/v2/test_share_access_rules.py,sha256=jXA3cFftznP9H9GlANzvQD1Z_dLw8byKOSAKNnZS6gg,21067
|
|
126
126
|
manilaclient/tests/unit/osc/v2/test_share_backups.py,sha256=vegKOqKJ150WSQqMiGbhHw5iMuRUdx_Bt3K-Ae9DKmU,13644
|
|
127
127
|
manilaclient/tests/unit/osc/v2/test_share_group_snapshots.py,sha256=zkchulCEXnzHQxgoVJmSo_LffCnPO2kEAu81sKHiL-8,21560
|
|
128
128
|
manilaclient/tests/unit/osc/v2/test_share_group_type.py,sha256=WCIdqbXqtsWsWZK7CSKkmI1X_8DMb-PR6ZeuTAwtkos,17697
|
|
@@ -216,7 +216,7 @@ manilaclient/v2/resource_locks.py,sha256=ocB21rxZEUXR5DHOkCuKetta5GEC5oTkAKSo4GP
|
|
|
216
216
|
manilaclient/v2/scheduler_stats.py,sha256=jPaDyUqZkHy9DPMHM-nqWKTv-Yii9Qh6YNAy-qqWp_U,1528
|
|
217
217
|
manilaclient/v2/security_services.py,sha256=xhUWdfcd6O3cq0OTjASSpTpUseUeoOgZkwBH2TqdJYM,9732
|
|
218
218
|
manilaclient/v2/services.py,sha256=Ap0eAxkI2tx8bdZtc_Hshb3THkAj4hiXU_xTenuSAKc,3942
|
|
219
|
-
manilaclient/v2/share_access_rules.py,sha256=
|
|
219
|
+
manilaclient/v2/share_access_rules.py,sha256=BbvKA67sapvUFvIo4cOXc2Yv3kkWdImoUJ7fPJE7wFg,3583
|
|
220
220
|
manilaclient/v2/share_backups.py,sha256=QQhRWT_txSd3wdGpg4NcrtV_N-wgdmQnhx9y3eOyGtI,4832
|
|
221
221
|
manilaclient/v2/share_export_locations.py,sha256=w72EE6-gQrD69-E4T8pZ4_oalz5lUEKIODCD2TQrRz8,2782
|
|
222
222
|
manilaclient/v2/share_group_snapshots.py,sha256=HmUUC3lbTKeD0j2fB-FyJANbIa3rl3PIThvcvSWsQFo,9326
|
|
@@ -241,11 +241,11 @@ manilaclient/v2/shares.py,sha256=Aletqm1t0nO62tBcJGw0QRNPCuN6XgJjPJXCQIl0TCk,321
|
|
|
241
241
|
manilaclient/v2/shell.py,sha256=IrbBbyo5ixaSgqxbM21EKGkoxnbAA5k0R-HXl50nboM,227987
|
|
242
242
|
manilaclient/v2/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
243
243
|
manilaclient/v2/contrib/list_extensions.py,sha256=_JSrPBEca2oR3dUbRNDBahAqo9V4bAEpNx0Si2gOWN4,1448
|
|
244
|
-
python_manilaclient-5.
|
|
245
|
-
python_manilaclient-5.
|
|
246
|
-
python_manilaclient-5.
|
|
247
|
-
python_manilaclient-5.
|
|
248
|
-
python_manilaclient-5.
|
|
249
|
-
python_manilaclient-5.
|
|
250
|
-
python_manilaclient-5.
|
|
251
|
-
python_manilaclient-5.
|
|
244
|
+
python_manilaclient-5.3.0.dist-info/AUTHORS,sha256=roa6rSbgpUcEuhPoutFEYCIa_bkk2R58a6VHogbFRqw,7587
|
|
245
|
+
python_manilaclient-5.3.0.dist-info/LICENSE,sha256=0vWIdNcdtTV9HZ7UlIezDadLSry5oS_2BzPolooTi4Y,11837
|
|
246
|
+
python_manilaclient-5.3.0.dist-info/METADATA,sha256=nm-f1bhFDFbUOSUZid095VCWTOHE816hYPZR12UgNYE,5449
|
|
247
|
+
python_manilaclient-5.3.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
248
|
+
python_manilaclient-5.3.0.dist-info/entry_points.txt,sha256=784yGhnBUEO4dXa2jFZzNs0M5HfOgESGrokIwmY3GDA,11861
|
|
249
|
+
python_manilaclient-5.3.0.dist-info/pbr.json,sha256=l0oHQ_LVd6PhKMD_wpZodxIkG7hgPY66GoB0xlY-gDw,46
|
|
250
|
+
python_manilaclient-5.3.0.dist-info/top_level.txt,sha256=qaZZFY6QOsBxs6dp1YW7M0XnIHyctWinAWIOOrnA0pQ,13
|
|
251
|
+
python_manilaclient-5.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "1b555af", "is_release": true}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "31e7ad9", "is_release": true}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|