diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2023-05-08 10:48:54 +0100 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2023-05-10 10:51:30 +0100 |
| commit | 28ffa2bf9f017212da5eb84b0cf74df62e2f5eb9 (patch) | |
| tree | e272d2bd82826a10df7e00855e35c78a27d2b6c9 /openstackclient/tests/functional/compute/v2/common.py | |
| parent | 5cb16aebcc53033ff1fd785b957eef0b7c9773e2 (diff) | |
| download | python-openstackclient-28ffa2bf9f017212da5eb84b0cf74df62e2f5eb9.tar.gz | |
Blacken openstackclient.compute
Black used with the '-l 79 -S' flags.
A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.
Change-Id: I9af45c062d179ab3dc2a5e969e1c467932753a2b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/functional/compute/v2/common.py')
| -rw-r--r-- | openstackclient/tests/functional/compute/v2/common.py | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/openstackclient/tests/functional/compute/v2/common.py b/openstackclient/tests/functional/compute/v2/common.py index 7eca4603..885dc1d9 100644 --- a/openstackclient/tests/functional/compute/v2/common.py +++ b/openstackclient/tests/functional/compute/v2/common.py @@ -53,9 +53,10 @@ class ComputeTestCase(base.TestCase): images = cls.openstack("image list", parse_output=True) server_image = None for image in images: - if (image['Name'].startswith('cirros-') and - (image['Name'].endswith('-uec') or - image['Name'].endswith('-disk'))): + if image['Name'].startswith('cirros-') and ( + image['Name'].endswith('-uec') + or image['Name'].endswith('-disk') + ): server_image = image['Name'] break return server_image @@ -83,12 +84,17 @@ class ComputeTestCase(base.TestCase): self.network_arg = self.get_network() name = name or uuid.uuid4().hex cmd_output = self.openstack( - 'server create ' + - '--flavor ' + self.flavor_name + ' ' + - '--image ' + self.image_name + ' ' + - self.network_arg + ' ' + - '--wait ' + - name, + 'server create ' + + '--flavor ' + + self.flavor_name + + ' ' + + '--image ' + + self.image_name + + ' ' + + self.network_arg + + ' ' + + '--wait ' + + name, parse_output=True, ) self.assertIsNotNone(cmd_output["id"]) @@ -106,11 +112,11 @@ class ComputeTestCase(base.TestCase): self.assertOutput('', raw_output) def wait_for_status( - self, - name, - expected_status='ACTIVE', - wait=900, - interval=10, + self, + name, + expected_status='ACTIVE', + wait=900, + interval=10, ): """Wait until server reaches expected status""" # TODO(thowe): Add a server wait command to osc @@ -118,24 +124,24 @@ class ComputeTestCase(base.TestCase): total_sleep = 0 while total_sleep < wait: cmd_output = self.openstack( - 'server show ' + - name, + 'server show ' + name, parse_output=True, ) status = cmd_output['status'] if status == expected_status: - print('Server {} now has status {}'.format( - name, status)) + print('Server {} now has status {}'.format(name, status)) break - print('Server {}: Waiting for {}, current status: {}'.format( - name, expected_status, status)) + print( + 'Server {}: Waiting for {}, current status: {}'.format( + name, expected_status, status + ) + ) self.assertNotIn(status, failures) time.sleep(interval) total_sleep += interval cmd_output = self.openstack( - 'server show ' + - name, + 'server show ' + name, parse_output=True, ) status = cmd_output['status'] |
