summaryrefslogtreecommitdiff
path: root/openstackclient/compute/client.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2023-05-08 10:48:54 +0100
committerStephen Finucane <sfinucan@redhat.com>2023-05-10 10:51:30 +0100
commit28ffa2bf9f017212da5eb84b0cf74df62e2f5eb9 (patch)
treee272d2bd82826a10df7e00855e35c78a27d2b6c9 /openstackclient/compute/client.py
parent5cb16aebcc53033ff1fd785b957eef0b7c9773e2 (diff)
downloadpython-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/compute/client.py')
-rw-r--r--openstackclient/compute/client.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py
index 6abfef04..e833d53b 100644
--- a/openstackclient/compute/client.py
+++ b/openstackclient/compute/client.py
@@ -51,11 +51,13 @@ def make_client(instance):
else:
version = instance._api_version[API_NAME]
from novaclient import api_versions
+
# convert to APIVersion object
version = api_versions.get_api_version(version)
if version.is_latest():
import novaclient
+
# NOTE(RuiChen): executing version discovery make sense, but that need
# an initialized REST client, it's not available now,
# fallback to use the max version of novaclient side.
@@ -73,8 +75,11 @@ def make_client(instance):
# Set client http_log_debug to True if verbosity level is high enough
http_log_debug = utils.get_effective_log_level() <= logging.DEBUG
- extensions = [ext for ext in nova_client.discover_extensions(version)
- if ext.name == "list_extensions"]
+ extensions = [
+ ext
+ for ext in nova_client.discover_extensions(version)
+ if ext.name == "list_extensions"
+ ]
# Remember interface only if it is set
kwargs = utils.build_kwargs_dict('endpoint_type', instance.interface)
@@ -96,7 +101,7 @@ def make_client(instance):
COMPUTE_API_TYPE,
region_name=instance.region_name,
interface=instance.interface,
- )
+ ),
)
return client
@@ -108,8 +113,10 @@ def build_option_parser(parser):
'--os-compute-api-version',
metavar='<compute-api-version>',
default=utils.env('OS_COMPUTE_API_VERSION'),
- help=_("Compute API version, default=%s "
- "(Env: OS_COMPUTE_API_VERSION)") % DEFAULT_API_VERSION
+ help=_(
+ "Compute API version, default=%s " "(Env: OS_COMPUTE_API_VERSION)"
+ )
+ % DEFAULT_API_VERSION,
)
return parser