summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src/main.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2020-01-10 16:48:14 +0530
committerKotresh HR <khiremat@redhat.com>2020-01-10 16:56:15 +0530
commit45894c39a4d05ed1f6a6f1bdbeafb5fe74ef29c3 (patch)
treefba794327dac678b862eb35d99be1951aaa5a7ce /tools/glusterfind/src/main.py
parent497d9f7d51443f4f463ca00f4fdddc42c6464e0f (diff)
glusterfind: Fix py2/py3 issues
1. In dictionary values(), returns list in py2 and not in py3. So explicitly convert it into list. 2. xattr module returns values in bytes. So explicitly convert them to str to work both with py2 and py3 fixes: bz#1789439 Change-Id: I27a639cda4f7a4ece9744a97c3d16e247906bd94 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'tools/glusterfind/src/main.py')
-rw-r--r--tools/glusterfind/src/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py
index aa3b93c8326..551bd925709 100644
--- a/tools/glusterfind/src/main.py
+++ b/tools/glusterfind/src/main.py
@@ -662,7 +662,7 @@ def mode_query(session_dir, args):
# Merger
if args.full:
if len(g_pid_nodefile_map) > 0:
- cmd = ["sort", "-u"] + g_pid_nodefile_map.values() + \
+ cmd = ["sort", "-u"] + list(g_pid_nodefile_map.values()) + \
["-o", args.outfile]
execute(cmd,
exit_msg="Failed to merge output files "
@@ -674,7 +674,7 @@ def mode_query(session_dir, args):
# Read each Changelogs db and generate finaldb
create_file(args.outfile, exit_on_err=True, logger=logger)
outfilemerger = OutputMerger(args.outfile + ".db",
- g_pid_nodefile_map.values())
+ list(g_pid_nodefile_map.values()))
write_output(args.outfile, outfilemerger, args.field_separator)
try:
@@ -731,7 +731,7 @@ def mode_pre(session_dir, args):
# Merger
if args.full:
if len(g_pid_nodefile_map) > 0:
- cmd = ["sort", "-u"] + g_pid_nodefile_map.values() + \
+ cmd = ["sort", "-u"] + list(g_pid_nodefile_map.values()) + \
["-o", args.outfile]
execute(cmd,
exit_msg="Failed to merge output files "
@@ -743,7 +743,7 @@ def mode_pre(session_dir, args):
# Read each Changelogs db and generate finaldb
create_file(args.outfile, exit_on_err=True, logger=logger)
outfilemerger = OutputMerger(args.outfile + ".db",
- g_pid_nodefile_map.values())
+ list(g_pid_nodefile_map.values()))
write_output(args.outfile, outfilemerger, args.field_separator)
try: