From 891c5844e187b627a5c661fcbcad8717413781cb Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Fri, 21 Jun 2019 10:49:14 +0530 Subject: 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 --- openshift-storage-libs/openshiftstoragelibs/openshift_storage_libs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openshift-storage-libs') 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] -- cgit