diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-01-25 19:24:22 +0530 |
---|---|---|
committer | Valerii Ponomarov <vponomar@redhat.com> | 2019-01-25 19:24:22 +0530 |
commit | 74abc644940996e641601851a9af71c0a10f28f5 (patch) | |
tree | 40c7f050f8bb6cfa93382e56a37fac94088cfbf2 /cns-libs | |
parent | efd7f6ffac516076a1201d2caeff3dc9edba3ab1 (diff) |
Add time limit for curl commands
In case of network problems, "curl" command may stuck in
a retry-loop. So, add explicit time-limit as 10 seconds to avoid
endless waiting of the functions which use it.
Change-Id: Ia2d94358e8f978cb73360535167c703da2636874
Diffstat (limited to 'cns-libs')
-rw-r--r-- | cns-libs/cnslibs/common/heketi_ops.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cns-libs/cnslibs/common/heketi_ops.py b/cns-libs/cnslibs/common/heketi_ops.py index 3b547d07..2d1b7385 100644 --- a/cns-libs/cnslibs/common/heketi_ops.py +++ b/cns-libs/cnslibs/common/heketi_ops.py @@ -407,7 +407,7 @@ def hello_heketi(heketi_client_node, heketi_server_url, **kwargs): heketi_server_url, json_arg, admin_key, user = _set_heketi_global_flags( heketi_server_url, **kwargs) - cmd = "curl %s/hello" % heketi_server_url + cmd = "curl --max-time 10 %s/hello" % heketi_server_url ret, out, err = g.run(heketi_client_node, cmd) if ret != 0: @@ -1446,7 +1446,7 @@ def get_heketi_metrics(heketi_client_node, heketi_server_url, Metrics output: if successful """ - cmd = "curl %s/metrics" % heketi_server_url + cmd = "curl --max-time 10 %s/metrics" % heketi_server_url ret, out, err = g.run(heketi_client_node, cmd) if ret != 0: msg = "failed to get Heketi metrics with following error: %s" % err |