ca3909
From bfb64a0e685eb5755ceda6c54690335564e135c9 Mon Sep 17 00:00:00 2001
ca3909
From: Hari Gowtham <hgowtham@redhat.com>
ca3909
Date: Mon, 16 Sep 2019 14:22:34 +0530
ca3909
Subject: [PATCH 296/297] glusterfind: pre command failure on a modify
ca3909
ca3909
Label: DOWNSTREAM ONLY
ca3909
ca3909
On upstream we have gfid_to_all_paths_using_gfid2path instead of
ca3909
gfid_to_path_using_pgfid and so we do not hit this in upstream.
ca3909
ca3909
Problem: On a modify, the pre commands runs through the find function.
ca3909
where the number of arguments sent mismatches and causes a stderr.
ca3909
The mismatch is because of both changelog and brickfind use the find(),
ca3909
but the brickfind was alone handled.
ca3909
ca3909
Fix: Have handled the additional argument on the changelog side as well.
ca3909
Received it as a dummy variable for changelog.
ca3909
ca3909
Change-Id: I5eecdd993e477b68a0e486db2ad7e56ba94bbf02
ca3909
fixes: bz#1733970
ca3909
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
ca3909
Reviewed-on: https://code.engineering.redhat.com/gerrit/181095
ca3909
Tested-by: RHGS Build Bot <nigelb@redhat.com>
ca3909
Reviewed-by: Aravinda Vishwanathapura Krishna Murthy <avishwan@redhat.com>
ca3909
Reviewed-by: Rinku Kothiya <rkothiya@redhat.com>
ca3909
---
ca3909
 tools/glusterfind/src/changelog.py | 5 +++--
ca3909
 tools/glusterfind/src/utils.py     | 2 +-
ca3909
 2 files changed, 4 insertions(+), 3 deletions(-)
ca3909
ca3909
diff --git a/tools/glusterfind/src/changelog.py b/tools/glusterfind/src/changelog.py
ca3909
index 40c381b..ef982db 100644
ca3909
--- a/tools/glusterfind/src/changelog.py
ca3909
+++ b/tools/glusterfind/src/changelog.py
ca3909
@@ -141,8 +141,9 @@ def gfid_to_path_using_pgfid(brick, changelog_data, args):
ca3909
 
ca3909
     # Length of brick path, to remove from output path
ca3909
     brick_path_len = len(brick)
ca3909
-
ca3909
-    def output_callback(path, inode):
ca3909
+    # is_dir is a dummy variable to make it compitable with the find
ca3909
+    # used in brickfind
ca3909
+    def output_callback(path, inode, is_dir):
ca3909
         # For each path found, encodes it and updates path1
ca3909
         # Also updates converted flag in inodegfid table as 1
ca3909
         path = path.strip()
ca3909
diff --git a/tools/glusterfind/src/utils.py b/tools/glusterfind/src/utils.py
ca3909
index cc09903..e226c5a 100644
ca3909
--- a/tools/glusterfind/src/utils.py
ca3909
+++ b/tools/glusterfind/src/utils.py
ca3909
@@ -70,7 +70,7 @@ def find(path, callback_func=lambda x: True, filter_func=lambda x: True,
ca3909
             else:
ca3909
                 filter_result = filter_func(full_path)
ca3909
                 if filter_result is not None:
ca3909
-                    callback_func(full_path, filter_result)
ca3909
+                    callback_func(full_path, filter_result, None)
ca3909
         else:
ca3909
             filter_result = filter_func(full_path)
ca3909
             if filter_result is not None:
ca3909
-- 
ca3909
1.8.3.1
ca3909