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