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