summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src/changelog.py
diff options
context:
space:
mode:
authorShwetha K Acharya <sacharya@redhat.com>2018-12-10 13:45:34 +0530
committerAmar Tumballi <amarts@redhat.com>2019-02-02 03:08:45 +0000
commit23e530a135fc419fba401448290f8b1809e23f53 (patch)
treeeb5d6e263ed151ae99f0c4c6ef82b6d8a094fc94 /tools/glusterfind/src/changelog.py
parenta229ee1c8cdf8e0ac1abaeb60cabe6ab08f60546 (diff)
glusterfind: python2 to python3 compat
Made necessary modifications to ensure python3 compatibilty. fixes: bz#1658116 Change-Id: I5cf1d0447eaf3c44eb444245d1f67aadd60705c3 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
Diffstat (limited to 'tools/glusterfind/src/changelog.py')
-rw-r--r--tools/glusterfind/src/changelog.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/glusterfind/src/changelog.py b/tools/glusterfind/src/changelog.py
index 437612ff0a4..62669e9507e 100644
--- a/tools/glusterfind/src/changelog.py
+++ b/tools/glusterfind/src/changelog.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com/>
@@ -339,7 +339,7 @@ def changelog_crawl(brick, start, end, args):
# WORKING_DIR/BRICKHASH/OUTFILE
working_dir = os.path.dirname(args.outfile)
- brickhash = hashlib.sha1(brick)
+ brickhash = hashlib.sha1(brick.encode())
brickhash = str(brickhash.hexdigest())
working_dir = os.path.join(working_dir, brickhash)
@@ -420,7 +420,7 @@ if __name__ == "__main__":
end))
actual_end = changelog_crawl(args.brick, start, end, args)
if not args.only_query:
- with open(status_file_pre, "w", buffering=0) as f:
+ with open(status_file_pre, "w") as f:
f.write(str(actual_end))
logger.info("%s Finished Changelog Crawl - End: %s" % (args.brick,