summaryrefslogtreecommitdiffstats
path: root/cns-libs/cnslibs/common/command.py
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-03-07 20:30:44 +0530
committervponomar <vponomar@redhat.com>2019-03-18 11:34:37 +0000
commit32b611b2a6498b1de307142e335e09d1e0ec082c (patch)
treeaaf600ab6e6adabab7c3facbf30ae6f056731969 /cns-libs/cnslibs/common/command.py
parent0fcdb081517c5904969b89b20326d21b361e448e (diff)
Reorder lib files removing redundant dir layer
Move all the files of 'cns-libs/cnslibs/common' dir to the 'openshift-storage-libs/openshiftstoragelibs', because 'common' is the only dir there, which doesn't really makes sense. And "cns" is old project name, so, replace it with "openshift-storage-libs". Also, fix all the imports of these libs. Change-Id: Ife00a73554e73b21b214b15016b0c8dbbf423446
Diffstat (limited to 'cns-libs/cnslibs/common/command.py')
-rw-r--r--cns-libs/cnslibs/common/command.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/cns-libs/cnslibs/common/command.py b/cns-libs/cnslibs/common/command.py
deleted file mode 100644
index 06912915..00000000
--- a/cns-libs/cnslibs/common/command.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from glusto.core import Glusto as g
-
-
-def cmd_run(cmd, hostname, raise_on_error=True):
- """Glusto's command runner wrapper.
-
- Args:
- cmd (str): Shell command to run on the specified hostname.
- hostname (str): hostname where Glusto should run specified command.
- raise_on_error (bool): defines whether we should raise exception
- in case command execution failed.
- Returns:
- str: Stripped shell command's stdout value if not None.
- """
- ret, out, err = g.run(hostname, cmd, "root")
- if raise_on_error:
- msg = ("Failed to execute command '%s' on '%s' node. Got non-zero "
- "return code '%s'. Err: %s" % (cmd, hostname, ret, err))
- assert int(ret) == 0, msg
-
- out = out.strip() if out else out
-
- return out