summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src/gfind_py2py3.py
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2017-01-05 19:53:19 +0530
committerRinku Kothiya <rkothiya@redhat.com>2020-01-13 14:54:00 +0000
commitcf0569e590afdb095bf0a0541bd91a502a90b461 (patch)
tree16694c9f18810ea2795dfc5b3cce3f6630e91a02 /tools/glusterfind/src/gfind_py2py3.py
parent98a940f0d42d42125821dbd0e08a2271c01dfc26 (diff)
tools/glusterfind: handle offline bricks
Problem: glusterfind is unable to copy remote output file to local node when a remove-brick is in progress on the remote node. After copying remote files, in the --full output listing path, a "sort -u" command is run on the collected files. However, "sort" exits with an error code if it finds any file missing. Solution: Maintain a map of (pid, output file) when the node commands are started and remove the mapping for the pid for which the command returns an error. Use the list of files present in the map for the "sort" command. Backport of: > Change-Id: Ie6e019037379f4cb163f24b1c65eb382efc2fb3b > fixes: bz#1410439 > Signed-off-by: Milind Changire <mchangir@redhat.com> > Signed-off-by: Shwetha K Acharya <sacharya@redhat.com> > (cherry picked from commit 42c1605f42b89520d4d05806d7074e9e93b63640) Change-Id: Ie6e019037379f4cb163f24b1c65eb382efc2fb3b Fixes: bz#1790428 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'tools/glusterfind/src/gfind_py2py3.py')
-rw-r--r--tools/glusterfind/src/gfind_py2py3.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/glusterfind/src/gfind_py2py3.py b/tools/glusterfind/src/gfind_py2py3.py
index 1d41ec5aa22..87324fbf350 100644
--- a/tools/glusterfind/src/gfind_py2py3.py
+++ b/tools/glusterfind/src/gfind_py2py3.py
@@ -40,6 +40,19 @@ if sys.version_info >= (3,):
def gfind_history_changelog_done(libgfc, clfile):
return libgfc.gf_history_changelog_done(clfile.encode())
+ def gfind_write_row(f, row, field_separator, p_rep, row_2_rep):
+ f.write(u"{0}{1}{2}{3}{4}\n".format(row,
+ field_separator,
+ p_rep,
+ field_separator,
+ row_2_rep))
+
+ def gfind_write(f, row, field_separator, p_rep):
+ f.write(u"{0}{1}{2}\n".format(row,
+ field_separator,
+ p_rep))
+
+
else:
# Raw conversion of bytearray to string
@@ -61,3 +74,15 @@ else:
def gfind_history_changelog_done(libgfc, clfile):
return libgfc.gf_history_changelog_done(clfile)
+
+ def gfind_write_row(f, row, field_separator, p_rep, row_2_rep):
+ f.write(u"{0}{1}{2}{3}{4}\n".format(row,
+ field_separator,
+ p_rep,
+ field_separator,
+ row_2_rep).encode())
+
+ def gfind_write(f, row, field_separator, p_rep):
+ f.write(u"{0}{1}{2}\n".format(row,
+ field_separator,
+ p_rep).encode())