summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-08-30 18:58:22 +0530
committervponomar <vponomar@redhat.com>2019-09-03 12:29:39 +0000
commitf711a5f1dd6df3e661d31b723792e5682e900773 (patch)
treee0fc7bc168ea2afbd40660e7a95875045a6958ed /openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
parent5c2f44b77449f47c5c9f437d580c2c6a73e27af0 (diff)
Fix pep8 errors in the files of the 'openshift-storage-libs' dir
Change-Id: Iaa7deca275958d4de68601dc16d1920f3dab85f2
Diffstat (limited to 'openshift-storage-libs/openshiftstoragelibs/heketi_ops.py')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/heketi_ops.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py b/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
index 78c2e073..489b8e9c 100644
--- a/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
+++ b/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
@@ -63,8 +63,8 @@ def heketi_cmd_run(hostname, cmd, raise_on_error=True):
g.log.error(
'Failed to run "%s" command on the "%s" host. '
'Got following error:\n%s' % (cmd, hostname, e))
- if ('connection refused' in six.text_type(e).lower() or
- 'operation timed out' in six.text_type(e).lower()):
+ if ('connection refused' in six.text_type(e).lower()
+ or 'operation timed out' in six.text_type(e).lower()):
time.sleep(1)
out = cmd_run_on_heketi_pod(cmd, raise_on_error=raise_on_error)
else:
@@ -75,8 +75,9 @@ def heketi_cmd_run(hostname, cmd, raise_on_error=True):
def _set_heketi_global_flags(heketi_server_url, **kwargs):
"""Helper function to set heketi-cli global flags."""
- heketi_server_url = (heketi_server_url if heketi_server_url else ("http:" +
- "//heketi-storage-project.cloudapps.mystorage.com"))
+ heketi_server_url = (
+ heketi_server_url if heketi_server_url else (
+ "http://heketi-storage-project.cloudapps.mystorage.com"))
json = kwargs.get("json")
secret = kwargs.get("secret")
user = kwargs.get("user")
@@ -145,8 +146,9 @@ def heketi_volume_create(heketi_client_node, heketi_server_url, size,
if heketi_cli_key is not None:
kwargs['secret'] = heketi_cli_key
- heketi_server_url = (heketi_server_url if heketi_server_url else ("http:" +
- "//heketi-storage-project.cloudapps.mystorage.com"))
+ heketi_server_url = (
+ heketi_server_url if heketi_server_url else (
+ "http://heketi-storage-project.cloudapps.mystorage.com"))
block_arg = "--block" if kwargs.get("block") else ""
clusters_arg = ("--clusters %s" % kwargs.get("clusters")
@@ -423,8 +425,8 @@ def hello_heketi(heketi_client_node, heketi_server_url, **kwargs):
g.log.error(
'Failed to run "%s" command on the "%s" host. '
'Got following error:\n%s' % (cmd, heketi_client_node, e))
- if ('connection refused' in six.text_type(e).lower() or
- 'operation timed out' in six.text_type(e).lower()):
+ if ('connection refused' in six.text_type(e).lower()
+ or 'operation timed out' in six.text_type(e).lower()):
time.sleep(1)
cmd_run_on_heketi_pod(
"curl --max-time 10 http://localhost:8080/hello")
@@ -1003,8 +1005,8 @@ def heketi_blockvolume_create(heketi_client_node, heketi_server_url, size,
auth = clusters = ha = name = None
if heketi_server_url is None:
- heketi_server_url = ("http://" +
- "heketi-storage-project.cloudapps.mystorage.com")
+ heketi_server_url = (
+ "http://heketi-storage-project.cloudapps.mystorage.com")
if 'auth' in kwargs:
auth = kwargs['auth']
@@ -1140,7 +1142,7 @@ def verify_volume_name_prefix(hostname, prefix, namespace, pvc_name,
heketi_server_url, json_arg, admin_key, user = _set_heketi_global_flags(
heketi_server_url, **kwargs)
- heketi_vol_name_prefix = "%s_%s_%s_" % (prefix, namespace, pvc_name)
+ heketi_vol_name_prefix = "%s_%s_%s_" % (prefix, namespace, pvc_name)
cmd = "heketi-cli -s %s volume list %s %s %s | grep %s" % (
heketi_server_url, json_arg, admin_key, user, heketi_vol_name_prefix)
cmd = TIMEOUT_PREFIX + cmd
@@ -1346,8 +1348,8 @@ def get_heketi_metrics(heketi_client_node, heketi_server_url,
g.log.error(
'Failed to run "%s" command on the "%s" host. '
'Got following error:\n%s' % (cmd, heketi_client_node, e))
- if ('connection refused' in six.text_type(e).lower() or
- 'operation timed out' in six.text_type(e).lower()):
+ if ('connection refused' in six.text_type(e).lower()
+ or 'operation timed out' in six.text_type(e).lower()):
time.sleep(1)
out = cmd_run_on_heketi_pod(
"curl --max-time 10 http://localhost:8080/metrics")