summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubansal <ubansal@redhat.com>2020-06-11 17:09:18 +0530
committerBala Konda Reddy M <bala12352@gmail.com>2020-06-15 06:19:05 +0000
commit0c51170b87c6d13d82f802e4174520f20064c49a (patch)
tree08f6ccc1726b95197523f7f63c0335535ce612fd
parentd9a4f33be4c28f02ad5478e022821fb38be5f4c3 (diff)
[LibFix] Add arequal support on given path
Calculates arequal for a particular path in the mountpoint Change-Id: I018302e6dbb11a9c11d42fc0381ec4183b3725a0 Signed-off-by: ubansal <ubansal@redhat.com>
-rwxr-xr-xglustolibs-io/glustolibs/io/utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/glustolibs-io/glustolibs/io/utils.py b/glustolibs-io/glustolibs/io/utils.py
index 2a2dff1..e4bb53b 100755
--- a/glustolibs-io/glustolibs/io/utils.py
+++ b/glustolibs-io/glustolibs/io/utils.py
@@ -27,12 +27,15 @@ from glustolibs.gluster.volume_libs import get_subvols
from glustolibs.misc.misc_libs import upload_scripts
-def collect_mounts_arequal(mounts):
+def collect_mounts_arequal(mounts, path=''):
"""Collects arequal from all the mounts
Args:
mounts (list): List of all GlusterMount objs.
+ Kwargs:
+ path (str): Path whose arequal is to be calculated.
+ Defaults to root of mountpoint
Returns:
tuple(bool, list):
On success returns (True, list of arequal-checksums of each mount)
@@ -47,9 +50,10 @@ def collect_mounts_arequal(mounts):
g.log.info("Start collecting arequal-checksum from all mounts")
all_mounts_procs = []
for mount_obj in mounts:
+ total_path = os.path.join(mount_obj.mountpoint, path)
g.log.info("arequal-checksum of mount %s:%s", mount_obj.client_system,
- mount_obj.mountpoint)
- cmd = "arequal-checksum -p %s -i .trashcan" % mount_obj.mountpoint
+ total_path)
+ cmd = "arequal-checksum -p %s -i .trashcan" % total_path
proc = g.run_async(mount_obj.client_system, cmd, user=mount_obj.user)
all_mounts_procs.append(proc)
all_mounts_arequal_checksums = []