summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Goyal <nigoyal@redhat.com>2019-06-21 10:49:14 +0530
committerNitin Goyal <nigoyal@redhat.com>2019-06-21 14:32:23 +0530
commit891c5844e187b627a5c661fcbcad8717413781cb (patch)
tree2b03c22aa2d6c49a8bba7ec7fb9829a63fb91fc4
parent2f3445b5fcb48f257950e3380ca22cf3e26abc4a (diff)
Fix 'get_active_and_enabled_devices_from_mpath' library
Sometimes grep cmd shows '--' symbol. Which is breaking code. So changed the code to exclude '--' via grep cmd. Change-Id: I3ef903e19196b2d0d70e074a676881725240983b
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py b/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py
index aef63961..ea37ee3d 100644
--- a/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py
+++ b/openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py
@@ -209,7 +209,7 @@ def get_active_and_enabled_devices_from_mpath(node, mpath):
"""
cmd = ("set -o pipefail && ((multipath -ll %s | grep -A 1 status=%s)"
- " | cut -d ':' -f 4 | awk '{print $2}')")
+ r" | grep -v '\-\-' | cut -d ':' -f 4 | awk '{print $2}')")
active = cmd_run(cmd % (mpath, 'active'), node).split('\n')[1::2]
enabled = cmd_run(cmd % (mpath, 'enabled'), node).split('\n')[1::2]