python-openstackclient 6.2.0__py3-none-any.whl → 6.2.1__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.
- openstackclient/identity/common.py +12 -0
- openstackclient/identity/v3/access_rule.py +8 -6
- openstackclient/network/v2/network_service_provider.py +16 -10
- openstackclient/tests/unit/identity/v3/test_access_rule.py +11 -11
- {python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/AUTHORS +1 -0
- {python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/METADATA +1 -1
- {python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/RECORD +12 -12
- python_openstackclient-6.2.1.dist-info/pbr.json +1 -0
- python_openstackclient-6.2.0.dist-info/pbr.json +0 -1
- {python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/LICENSE +0 -0
- {python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/WHEEL +0 -0
- {python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/entry_points.txt +0 -0
- {python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/top_level.txt +0 -0
|
@@ -87,6 +87,18 @@ def get_resource(manager, name_type_or_id):
|
|
|
87
87
|
raise exceptions.CommandError(msg % name_type_or_id)
|
|
88
88
|
|
|
89
89
|
|
|
90
|
+
def get_resource_by_id(manager, resource_id):
|
|
91
|
+
"""Get resource by ID
|
|
92
|
+
|
|
93
|
+
Raises CommandError if the resource is not found
|
|
94
|
+
"""
|
|
95
|
+
try:
|
|
96
|
+
return manager.get(resource_id)
|
|
97
|
+
except identity_exc.NotFound:
|
|
98
|
+
msg = _("Resource with id {} not found")
|
|
99
|
+
raise exceptions.CommandError(msg.format(resource_id))
|
|
100
|
+
|
|
101
|
+
|
|
90
102
|
def _get_token_resource(client, resource, parsed_name, parsed_domain=None):
|
|
91
103
|
"""Peek into the user's auth token to get resource IDs
|
|
92
104
|
|
|
@@ -37,7 +37,7 @@ class DeleteAccessRule(command.Command):
|
|
|
37
37
|
'access_rule',
|
|
38
38
|
metavar='<access-rule>',
|
|
39
39
|
nargs="+",
|
|
40
|
-
help=_('Access rule(s) to delete
|
|
40
|
+
help=_('Access rule ID(s) to delete'),
|
|
41
41
|
)
|
|
42
42
|
return parser
|
|
43
43
|
|
|
@@ -47,8 +47,9 @@ class DeleteAccessRule(command.Command):
|
|
|
47
47
|
errors = 0
|
|
48
48
|
for ac in parsed_args.access_rule:
|
|
49
49
|
try:
|
|
50
|
-
access_rule =
|
|
51
|
-
identity_client.access_rules, ac
|
|
50
|
+
access_rule = common.get_resource_by_id(
|
|
51
|
+
identity_client.access_rules, ac
|
|
52
|
+
)
|
|
52
53
|
identity_client.access_rules.delete(access_rule.id)
|
|
53
54
|
except Exception as e:
|
|
54
55
|
errors += 1
|
|
@@ -103,14 +104,15 @@ class ShowAccessRule(command.ShowOne):
|
|
|
103
104
|
parser.add_argument(
|
|
104
105
|
'access_rule',
|
|
105
106
|
metavar='<access-rule>',
|
|
106
|
-
help=_('Access rule to display
|
|
107
|
+
help=_('Access rule ID to display'),
|
|
107
108
|
)
|
|
108
109
|
return parser
|
|
109
110
|
|
|
110
111
|
def take_action(self, parsed_args):
|
|
111
112
|
identity_client = self.app.client_manager.identity
|
|
112
|
-
access_rule =
|
|
113
|
-
|
|
113
|
+
access_rule = common.get_resource_by_id(
|
|
114
|
+
identity_client.access_rules, parsed_args.access_rule
|
|
115
|
+
)
|
|
114
116
|
|
|
115
117
|
access_rule._info.pop('links', None)
|
|
116
118
|
|
|
@@ -26,18 +26,24 @@ class ListNetworkServiceProvider(command.Lister):
|
|
|
26
26
|
client = self.app.client_manager.network
|
|
27
27
|
|
|
28
28
|
columns = (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
"service_type",
|
|
30
|
+
"name",
|
|
31
|
+
"is_default",
|
|
32
32
|
)
|
|
33
33
|
column_headers = (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
"Service Type",
|
|
35
|
+
"Name",
|
|
36
|
+
"Default",
|
|
37
37
|
)
|
|
38
38
|
|
|
39
39
|
data = client.service_providers()
|
|
40
|
-
return(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
return (
|
|
41
|
+
column_headers,
|
|
42
|
+
(
|
|
43
|
+
utils.get_item_properties(
|
|
44
|
+
s,
|
|
45
|
+
columns,
|
|
46
|
+
)
|
|
47
|
+
for s in data
|
|
48
|
+
),
|
|
49
|
+
)
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
#
|
|
15
15
|
|
|
16
16
|
import copy
|
|
17
|
-
from unittest import mock
|
|
18
17
|
|
|
18
|
+
from keystoneclient import exceptions as identity_exc
|
|
19
19
|
from osc_lib import exceptions
|
|
20
|
-
from osc_lib import utils
|
|
21
20
|
|
|
22
21
|
from openstackclient.identity.v3 import access_rule
|
|
23
22
|
from openstackclient.tests.unit import fakes
|
|
@@ -69,10 +68,13 @@ class TestAccessRuleDelete(TestAccessRule):
|
|
|
69
68
|
)
|
|
70
69
|
self.assertIsNone(result)
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
def test_delete_multi_access_rules_with_exception(self):
|
|
72
|
+
# mock returns for common.get_resource_by_id
|
|
73
|
+
mock_get = self.access_rules_mock.get
|
|
74
|
+
mock_get.side_effect = [
|
|
75
|
+
mock_get.return_value,
|
|
76
|
+
identity_exc.NotFound,
|
|
77
|
+
]
|
|
76
78
|
arglist = [
|
|
77
79
|
identity_fakes.access_rule_id,
|
|
78
80
|
'nonexistent_access_rule',
|
|
@@ -89,12 +91,10 @@ class TestAccessRuleDelete(TestAccessRule):
|
|
|
89
91
|
self.assertEqual('1 of 2 access rules failed to'
|
|
90
92
|
' delete.', str(e))
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
find_mock.assert_any_call(self.access_rules_mock,
|
|
95
|
-
'nonexistent_access_rule')
|
|
94
|
+
mock_get.assert_any_call(identity_fakes.access_rule_id)
|
|
95
|
+
mock_get.assert_any_call('nonexistent_access_rule')
|
|
96
96
|
|
|
97
|
-
self.assertEqual(2,
|
|
97
|
+
self.assertEqual(2, mock_get.call_count)
|
|
98
98
|
self.access_rules_mock.delete.assert_called_once_with(
|
|
99
99
|
identity_fakes.access_rule_id)
|
|
100
100
|
|
|
@@ -110,6 +110,7 @@ Doug Hellmann <doug.hellmann@dreamhost.com>
|
|
|
110
110
|
Doug Hellmann <doug@doughellmann.com>
|
|
111
111
|
Doug Wiegley <dwiegley@salesforce.com>
|
|
112
112
|
Dougal Matthews <dougal@redhat.com>
|
|
113
|
+
Douglas Mendizábal <dmendiza@redhat.com>
|
|
113
114
|
Dr. Jens Harbott <harbott@osism.tech>
|
|
114
115
|
Einst Crazy <yu.changcai@99cloud.net>
|
|
115
116
|
Elena Ezhova <eezhova@mirantis.com>
|
|
@@ -41,7 +41,7 @@ openstackclient/compute/v2/service.py,sha256=lFOh49wQNlFWeNGlhYdclyg_ALLEMIfy83P
|
|
|
41
41
|
openstackclient/compute/v2/usage.py,sha256=PFR5zuev2Sfo96lkUrPln_-R_I228PUGCEzUgu_kJvM,8937
|
|
42
42
|
openstackclient/identity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
openstackclient/identity/client.py,sha256=O4GgzRaSKpzgxvA24-beDDb6HFuFJR3XQ3WqkdPr5NQ,2433
|
|
44
|
-
openstackclient/identity/common.py,sha256=
|
|
44
|
+
openstackclient/identity/common.py,sha256=72nCrrkl4wbYE6-DZB5-sJqXun5b1ShbjvQTCyVD4KA,11167
|
|
45
45
|
openstackclient/identity/v2_0/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
46
|
openstackclient/identity/v2_0/catalog.py,sha256=5KPtImNGcIsiCqaATiLtVg5ymN95RoqK0bN87wDnJrM,3398
|
|
47
47
|
openstackclient/identity/v2_0/ec2creds.py,sha256=3-QtZrse0ZhiD8OlImzyZG6uOzG0vgrXXkcGzKcW5i4,6433
|
|
@@ -53,7 +53,7 @@ openstackclient/identity/v2_0/service.py,sha256=JqF-kPIOmtEd5s3cbCi1pDmzSDwQvN80
|
|
|
53
53
|
openstackclient/identity/v2_0/token.py,sha256=wP06EE393ddc08UjIBREKq_Tzrgs7L_cN_P-AU3Pwd0,2227
|
|
54
54
|
openstackclient/identity/v2_0/user.py,sha256=shd-FShR1pcNgAVnJPfc_AR7fbEjKNWTQoUMAMdCpV0,13247
|
|
55
55
|
openstackclient/identity/v3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
-
openstackclient/identity/v3/access_rule.py,sha256=
|
|
56
|
+
openstackclient/identity/v3/access_rule.py,sha256=9QOpwb8az_jeSjzUaSq0F88dW2USWplaPjUAbRvDMq0,3902
|
|
57
57
|
openstackclient/identity/v3/application_credential.py,sha256=FcZGaP2FYnMGWKP7dyP1qtfH6vTpVtg1XnentnLZAWo,9177
|
|
58
58
|
openstackclient/identity/v3/catalog.py,sha256=Csy-1UUUPxhsjxB15bAh0OcjfvLd0L-MRPQOT6_Mnhw,3204
|
|
59
59
|
openstackclient/identity/v3/consumer.py,sha256=0g7uKEb_oAV3wTMly0IY4ogbvYLBOQC8cvGg-6qwGAY,4679
|
|
@@ -118,7 +118,7 @@ openstackclient/network/v2/network_qos_rule_type.py,sha256=-6RHHjzxVQ7lWXHMbCSWY
|
|
|
118
118
|
openstackclient/network/v2/network_rbac.py,sha256=mtS_wWjX5noqS0NyvSGl7dE8CkZ0T0YQ71vUegsFcQM,12138
|
|
119
119
|
openstackclient/network/v2/network_segment.py,sha256=E0j14mxPgDsWCZ3wQ_-cjUskUU1ZfXpLQxpPTgLyrkc,8710
|
|
120
120
|
openstackclient/network/v2/network_segment_range.py,sha256=u_0qNX_SgXBj7l-jBLwXkAdR28Nn2NjV7d4kemzYIjY,17190
|
|
121
|
-
openstackclient/network/v2/network_service_provider.py,sha256=
|
|
121
|
+
openstackclient/network/v2/network_service_provider.py,sha256=b0pKHxB5Qq1U2lfOCWHKJ8CMX661gBbKtv0jXvuE3Xg,1384
|
|
122
122
|
openstackclient/network/v2/network_trunk.py,sha256=cjHGNbRiS7nXn-IDpau5pHLxdtwuATVtKGIsqsE_5Y8,14028
|
|
123
123
|
openstackclient/network/v2/port.py,sha256=4W5GqMKw2HnMZDY6gcsH7XnwTNluAiKPgLLFEzkAqZM,41064
|
|
124
124
|
openstackclient/network/v2/router.py,sha256=zsr4oHaw0WhNQmIvPrfb1U-K0rK_hXf0kpExsnIErmA,36215
|
|
@@ -307,7 +307,7 @@ openstackclient/tests/unit/identity/v2_0/test_token.py,sha256=U5xvDVhqoWKlMtQJ7C
|
|
|
307
307
|
openstackclient/tests/unit/identity/v2_0/test_user.py,sha256=10IWTMivtM1_OSQ9gGSjgijFHxurt7Bl1d6ZWwQh5aA,25322
|
|
308
308
|
openstackclient/tests/unit/identity/v3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
309
309
|
openstackclient/tests/unit/identity/v3/fakes.py,sha256=uxc51jJSrr08l7czr0mbXmZB_QJOb8jNKWTaWqxLryI,34955
|
|
310
|
-
openstackclient/tests/unit/identity/v3/test_access_rule.py,sha256=
|
|
310
|
+
openstackclient/tests/unit/identity/v3/test_access_rule.py,sha256=5ZVw6M0nn8F2cyT7LQB2F6O3Qx0r9WJuyAmfhEnvBCo,5599
|
|
311
311
|
openstackclient/tests/unit/identity/v3/test_application_credential.py,sha256=D1EO49CBqWSF4gAV3edOinj8AeuitGqXTxAbW4IOqH4,14492
|
|
312
312
|
openstackclient/tests/unit/identity/v3/test_catalog.py,sha256=4rDq3QkRy8KghpgxffdgIHgPdrweZbM8VWAGuN8l_vc,4897
|
|
313
313
|
openstackclient/tests/unit/identity/v3/test_consumer.py,sha256=jK5fSrOBqM5gw_VUPkQU8hr-DOAHFyVWEsOvUvFWufI,6837
|
|
@@ -467,11 +467,11 @@ openstackclient/volume/v3/volume_group.py,sha256=99F6h80FWFLiBfE2Sl-c4qnfQVPQMQj
|
|
|
467
467
|
openstackclient/volume/v3/volume_group_snapshot.py,sha256=D22s5ntEcUNy8TVVHkZOu7TA8ouaXi8ujkBq5ZuIF6k,6936
|
|
468
468
|
openstackclient/volume/v3/volume_group_type.py,sha256=jgn-qlZKhOFhr9ImvHFHOR8BvjVlVt93f39DJLBPfJE,12579
|
|
469
469
|
openstackclient/volume/v3/volume_message.py,sha256=MpQUFHWITqVaqTsKg3_B_-f4I2RGAV3PpUxY8cj04oM,5173
|
|
470
|
-
python_openstackclient-6.2.
|
|
471
|
-
python_openstackclient-6.2.
|
|
472
|
-
python_openstackclient-6.2.
|
|
473
|
-
python_openstackclient-6.2.
|
|
474
|
-
python_openstackclient-6.2.
|
|
475
|
-
python_openstackclient-6.2.
|
|
476
|
-
python_openstackclient-6.2.
|
|
477
|
-
python_openstackclient-6.2.
|
|
470
|
+
python_openstackclient-6.2.1.dist-info/AUTHORS,sha256=nJbWkAiUutJnfeF-wHwrYObbIPdosIOC2XdIHpa9lxs,20193
|
|
471
|
+
python_openstackclient-6.2.1.dist-info/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
|
|
472
|
+
python_openstackclient-6.2.1.dist-info/METADATA,sha256=HBWrybr3GXsnWgNXvOPWEWU2atEWf0BVBc8gQ46wyao,6469
|
|
473
|
+
python_openstackclient-6.2.1.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
|
|
474
|
+
python_openstackclient-6.2.1.dist-info/entry_points.txt,sha256=BjwZ6EzUVhRjJnWppdeyHD2tte2i0Lcvs0xrYM-vnYs,50595
|
|
475
|
+
python_openstackclient-6.2.1.dist-info/pbr.json,sha256=7m8bKh9ypnq5JA6ZOdmuW5ZVz8E-qtipYulTDExGE3A,47
|
|
476
|
+
python_openstackclient-6.2.1.dist-info/top_level.txt,sha256=htg7z9oZgysRuVUHn-m1Bk6XLGOeV65nMbZX9H8qhs0,16
|
|
477
|
+
python_openstackclient-6.2.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "02172959", "is_release": true}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "05d34ffc", "is_release": true}
|
|
File without changes
|
|
File without changes
|
{python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{python_openstackclient-6.2.0.dist-info → python_openstackclient-6.2.1.dist-info}/top_level.txt
RENAMED
|
File without changes
|