python-openstackclient 8.0.0__py3-none-any.whl → 8.1.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.
- openstackclient/compute/client.py +5 -0
- openstackclient/compute/v2/console.py +7 -0
- openstackclient/compute/v2/console_connection.py +48 -0
- openstackclient/compute/v2/keypair.py +10 -3
- openstackclient/compute/v2/server.py +75 -10
- openstackclient/compute/v2/server_event.py +1 -1
- openstackclient/identity/common.py +79 -0
- openstackclient/identity/v3/application_credential.py +2 -2
- openstackclient/identity/v3/domain.py +62 -43
- openstackclient/identity/v3/group.py +113 -68
- openstackclient/identity/v3/project.py +17 -0
- openstackclient/identity/v3/user.py +38 -5
- openstackclient/image/client.py +5 -0
- openstackclient/image/v2/image.py +11 -11
- openstackclient/network/client.py +0 -6
- openstackclient/network/v2/floating_ip.py +58 -29
- openstackclient/network/v2/network_qos_rule.py +3 -11
- openstackclient/network/v2/router.py +1 -1
- openstackclient/network/v2/security_group.py +5 -4
- openstackclient/network/v2/security_group_rule.py +1 -1
- openstackclient/shell.py +1 -1
- openstackclient/tests/functional/base.py +5 -1
- openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
- openstackclient/tests/unit/compute/v2/fakes.py +81 -305
- openstackclient/tests/unit/compute/v2/test_console.py +18 -1
- openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +12 -5
- openstackclient/tests/unit/compute/v2/test_server.py +169 -46
- openstackclient/tests/unit/compute/v2/test_server_backup.py +32 -71
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_image.py +33 -72
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/identity/v3/test_application_credential.py +47 -25
- openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
- openstackclient/tests/unit/identity/v3/test_group.py +353 -202
- openstackclient/tests/unit/identity/v3/test_project.py +16 -0
- openstackclient/tests/unit/identity/v3/test_user.py +86 -6
- openstackclient/tests/unit/image/v1/test_image.py +8 -9
- openstackclient/tests/unit/image/v2/test_image.py +49 -49
- openstackclient/tests/unit/network/v2/fakes.py +405 -485
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +13 -19
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
- openstackclient/tests/unit/network/v2/test_network.py +4 -4
- openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
- openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +17 -17
- openstackclient/tests/unit/network/v2/test_router.py +73 -57
- openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +1 -3
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
- openstackclient/tests/unit/volume/v2/fakes.py +1 -2
- openstackclient/tests/unit/volume/v2/test_service.py +57 -91
- openstackclient/tests/unit/volume/v2/test_volume.py +108 -105
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +61 -71
- openstackclient/tests/unit/volume/v3/test_service.py +221 -141
- openstackclient/tests/unit/volume/v3/test_volume.py +130 -119
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +682 -47
- openstackclient/volume/v2/service.py +41 -38
- openstackclient/volume/v2/volume.py +63 -37
- openstackclient/volume/v2/volume_backup.py +9 -3
- openstackclient/volume/v2/volume_snapshot.py +121 -84
- openstackclient/volume/v3/block_storage_log_level.py +22 -28
- openstackclient/volume/v3/service.py +105 -14
- openstackclient/volume/v3/volume.py +200 -39
- openstackclient/volume/v3/volume_backup.py +24 -19
- openstackclient/volume/v3/volume_snapshot.py +485 -10
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +8 -0
- python_openstackclient-8.1.0.dist-info/METADATA +264 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +83 -81
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -6
- python_openstackclient-8.1.0.dist-info/pbr.json +1 -0
- python_openstackclient-8.0.0.dist-info/METADATA +0 -166
- python_openstackclient-8.0.0.dist-info/pbr.json +0 -1
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-8.0.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
2
|
+
# not use this file except in compliance with the License. You may obtain
|
|
3
|
+
# a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
|
+
# License for the specific language governing permissions and limitations
|
|
11
|
+
# under the License.
|
|
12
|
+
|
|
13
|
+
import uuid
|
|
14
|
+
|
|
15
|
+
from openstack.compute.v2 import console_auth_token as _console_auth_token
|
|
16
|
+
from openstack.test import fakes as sdk_fakes
|
|
17
|
+
|
|
18
|
+
from openstackclient.compute.v2 import console_connection
|
|
19
|
+
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class TestConsoleTokens(compute_fakes.TestComputev2):
|
|
23
|
+
def setUp(self):
|
|
24
|
+
super().setUp()
|
|
25
|
+
|
|
26
|
+
self._console_auth_token = sdk_fakes.generate_fake_resource(
|
|
27
|
+
_console_auth_token.ConsoleAuthToken,
|
|
28
|
+
host='127.0.0.1',
|
|
29
|
+
instance_uuid=uuid.uuid4().hex,
|
|
30
|
+
internal_access_path=None,
|
|
31
|
+
port=5900,
|
|
32
|
+
tls_port=5901,
|
|
33
|
+
)
|
|
34
|
+
self.compute_client.validate_console_auth_token.return_value = (
|
|
35
|
+
self._console_auth_token
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
self.columns = (
|
|
39
|
+
'host',
|
|
40
|
+
'instance_uuid',
|
|
41
|
+
'internal_access_path',
|
|
42
|
+
'port',
|
|
43
|
+
'tls_port',
|
|
44
|
+
)
|
|
45
|
+
self.data = (
|
|
46
|
+
self._console_auth_token.host,
|
|
47
|
+
self._console_auth_token.instance_uuid,
|
|
48
|
+
self._console_auth_token.internal_access_path,
|
|
49
|
+
self._console_auth_token.port,
|
|
50
|
+
self._console_auth_token.tls_port,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
self.cmd = console_connection.ShowConsoleConnectionInformation(
|
|
54
|
+
self.app, None
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def test_console_connection_show(self):
|
|
58
|
+
arglist = [
|
|
59
|
+
'token',
|
|
60
|
+
]
|
|
61
|
+
verifylist = [
|
|
62
|
+
('token', 'token'),
|
|
63
|
+
]
|
|
64
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
65
|
+
|
|
66
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
67
|
+
|
|
68
|
+
self.compute_client.validate_console_auth_token.assert_called_once_with(
|
|
69
|
+
'token'
|
|
70
|
+
)
|
|
71
|
+
self.assertEqual(self.columns, columns)
|
|
72
|
+
self.assertEqual(self.data, data)
|
|
@@ -1052,7 +1052,7 @@ class TestFlavorShow(TestFlavor):
|
|
|
1052
1052
|
data_with_project = (
|
|
1053
1053
|
private_flavor.is_disabled,
|
|
1054
1054
|
private_flavor.ephemeral,
|
|
1055
|
-
[self.flavor_access
|
|
1055
|
+
[self.flavor_access['tenant_id']],
|
|
1056
1056
|
private_flavor.description,
|
|
1057
1057
|
private_flavor.disk,
|
|
1058
1058
|
private_flavor.id,
|
|
@@ -18,6 +18,7 @@ import uuid
|
|
|
18
18
|
|
|
19
19
|
from openstack.compute.v2 import keypair as _keypair
|
|
20
20
|
from openstack.identity.v3 import project as _project
|
|
21
|
+
from openstack.identity.v3 import role_assignment as _role_assignment
|
|
21
22
|
from openstack.identity.v3 import user as _user
|
|
22
23
|
from openstack.test import fakes as sdk_fakes
|
|
23
24
|
from osc_lib import exceptions
|
|
@@ -529,13 +530,17 @@ class TestKeypairList(TestKeypair):
|
|
|
529
530
|
def test_keypair_list_with_project(self):
|
|
530
531
|
self.set_compute_api_version('2.35')
|
|
531
532
|
|
|
532
|
-
projects_mock = self.identity_client.
|
|
533
|
+
projects_mock = self.identity_client.projects
|
|
533
534
|
projects_mock.reset_mock()
|
|
534
535
|
projects_mock.get.return_value = self._project
|
|
535
536
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
role_assignments_mock = self.identity_sdk_client.role_assignments
|
|
538
|
+
role_assignments_mock.reset_mock()
|
|
539
|
+
assignment = sdk_fakes.generate_fake_resource(
|
|
540
|
+
_role_assignment.RoleAssignment
|
|
541
|
+
)
|
|
542
|
+
assignment.user = self._user
|
|
543
|
+
role_assignments_mock.return_value = [assignment]
|
|
539
544
|
|
|
540
545
|
arglist = ['--project', self._project.name]
|
|
541
546
|
verifylist = [('project', self._project.name)]
|
|
@@ -544,7 +549,9 @@ class TestKeypairList(TestKeypair):
|
|
|
544
549
|
columns, data = self.cmd.take_action(parsed_args)
|
|
545
550
|
|
|
546
551
|
projects_mock.get.assert_called_with(self._project.name)
|
|
547
|
-
|
|
552
|
+
role_assignments_mock.assert_called_with(
|
|
553
|
+
scope_project_id=self._project.id
|
|
554
|
+
)
|
|
548
555
|
self.compute_client.keypairs.assert_called_with(
|
|
549
556
|
user_id=self._user.id,
|
|
550
557
|
)
|