From 3ac2579229ff6e6a2ced7b76a20b9f2822cced1a Mon Sep 17 00:00:00 2001 From: Arjun Sharma Date: Thu, 26 Sep 2019 17:21:56 +0530 Subject: Using egrep instead of grep Since egrep treats a pattern as extended regular expression it is more suited to be used in this case. The current usage of grep fails to identify the expression after the first pipe. Change-Id: Id02f884356048c56066a406937f8d86456ee8bd7 Signed-off-by: Arjun Sharma --- glustolibs-gluster/glustolibs/gluster/mount_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'glustolibs-gluster') diff --git a/glustolibs-gluster/glustolibs/gluster/mount_ops.py b/glustolibs-gluster/glustolibs/gluster/mount_ops.py index cc63d0588..c41ef8528 100755 --- a/glustolibs-gluster/glustolibs/gluster/mount_ops.py +++ b/glustolibs-gluster/glustolibs/gluster/mount_ops.py @@ -261,7 +261,7 @@ def is_mounted(volname, mpoint, mserver, mclient, mtype, user='root'): return True return False else: - ret, _, _ = g.run(mclient, "mount | grep %s | grep %s | grep \"%s\"" + ret, _, _ = g.run(mclient, "mount | egrep '%s | %s' | grep \"%s\"" % (volname, mpoint, mserver), user) if ret == 0: g.log.debug("Volume %s is mounted at %s:%s" % (volname, mclient, -- cgit