summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src
diff options
context:
space:
mode:
Diffstat (limited to 'tools/glusterfind/src')
-rw-r--r--tools/glusterfind/src/brickfind.py4
-rw-r--r--tools/glusterfind/src/changelog.py6
-rw-r--r--tools/glusterfind/src/main.py4
-rw-r--r--tools/glusterfind/src/nodeagent.py6
-rw-r--r--tools/glusterfind/src/utils.py6
5 files changed, 13 insertions, 13 deletions
diff --git a/tools/glusterfind/src/brickfind.py b/tools/glusterfind/src/brickfind.py
index 6b430d3b9d2..e24fb1f0bdf 100644
--- a/tools/glusterfind/src/brickfind.py
+++ b/tools/glusterfind/src/brickfind.py
@@ -13,7 +13,7 @@ import os
import sys
import logging
from argparse import ArgumentParser, RawDescriptionHelpFormatter
-import urllib
+import urllib.request, urllib.parse, urllib.error
import time
from utils import mkdirp, setup_logger, create_file, output_write, find
@@ -84,7 +84,7 @@ if __name__ == "__main__":
args = _get_args()
session_dir = os.path.join(conf.get_opt("session_dir"), args.session)
status_file = os.path.join(session_dir, args.volume,
- "%s.status" % urllib.quote_plus(args.brick))
+ "%s.status" % urllib.parse.quote_plus(args.brick))
status_file_pre = status_file + ".pre"
mkdirp(os.path.join(session_dir, args.volume), exit_on_err=True,
logger=logger)
diff --git a/tools/glusterfind/src/changelog.py b/tools/glusterfind/src/changelog.py
index b124ae7e168..608b5c7c2de 100644
--- a/tools/glusterfind/src/changelog.py
+++ b/tools/glusterfind/src/changelog.py
@@ -16,7 +16,7 @@ import xattr
import logging
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import hashlib
-import urllib
+import urllib.request, urllib.parse, urllib.error
import codecs
import libgfchangelog
@@ -243,7 +243,7 @@ def get_changes(brick, hash_dir, log_file, start, end, args):
session_dir = os.path.join(conf.get_opt("session_dir"),
args.session)
status_file = os.path.join(session_dir, args.volume,
- "%s.status" % urllib.quote_plus(args.brick))
+ "%s.status" % urllib.parse.quote_plus(args.brick))
# Get previous session
try:
@@ -380,7 +380,7 @@ if __name__ == "__main__":
session_dir = os.path.join(conf.get_opt("session_dir"), args.session)
status_file = os.path.join(session_dir, args.volume,
- "%s.status" % urllib.quote_plus(args.brick))
+ "%s.status" % urllib.parse.quote_plus(args.brick))
status_file_pre = status_file + ".pre"
mkdirp(os.path.join(session_dir, args.volume), exit_on_err=True,
logger=logger)
diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py
index 3e7a729338c..2b782c8dca4 100644
--- a/tools/glusterfind/src/main.py
+++ b/tools/glusterfind/src/main.py
@@ -503,13 +503,13 @@ def write_output(outfile, outfilemerger, field_separator):
continue
if row_2_rep and row_2_rep != "":
- f.write(u"{0}{1}{2}{3}{4}\n".format(row[0],
+ f.write("{0}{1}{2}{3}{4}\n".format(row[0],
field_separator,
p_rep,
field_separator,
row_2_rep))
else:
- f.write(u"{0}{1}{2}\n".format(row[0],
+ f.write("{0}{1}{2}\n".format(row[0],
field_separator,
p_rep))
diff --git a/tools/glusterfind/src/nodeagent.py b/tools/glusterfind/src/nodeagent.py
index e921bc0df43..c337964c7db 100644
--- a/tools/glusterfind/src/nodeagent.py
+++ b/tools/glusterfind/src/nodeagent.py
@@ -14,7 +14,7 @@ import sys
import os
import logging
from argparse import ArgumentParser, RawDescriptionHelpFormatter
-import urllib
+import urllib.request, urllib.parse, urllib.error
from errno import ENOTEMPTY
from utils import setup_logger, mkdirp, handle_rm_error
@@ -49,7 +49,7 @@ def mode_create(args):
session_dir = os.path.join(conf.get_opt("session_dir"),
args.session)
status_file = os.path.join(session_dir, args.volume,
- "%s.status" % urllib.quote_plus(args.brick))
+ "%s.status" % urllib.parse.quote_plus(args.brick))
mkdirp(os.path.join(session_dir, args.volume), exit_on_err=True,
logger=logger)
@@ -64,7 +64,7 @@ def mode_create(args):
def mode_post(args):
session_dir = os.path.join(conf.get_opt("session_dir"), args.session)
status_file = os.path.join(session_dir, args.volume,
- "%s.status" % urllib.quote_plus(args.brick))
+ "%s.status" % urllib.parse.quote_plus(args.brick))
mkdirp(os.path.join(session_dir, args.volume), exit_on_err=True,
logger=logger)
diff --git a/tools/glusterfind/src/utils.py b/tools/glusterfind/src/utils.py
index c24258e6ef8..b376241820b 100644
--- a/tools/glusterfind/src/utils.py
+++ b/tools/glusterfind/src/utils.py
@@ -36,10 +36,10 @@ class RecordType(object):
def cache_output(func):
def wrapper(*args, **kwargs):
global cache_data
- if cache_data.get(func.func_name, None) is None:
- cache_data[func.func_name] = func(*args, **kwargs)
+ if cache_data.get(func.__name__, None) is None:
+ cache_data[func.__name__] = func(*args, **kwargs)
- return cache_data[func.func_name]
+ return cache_data[func.__name__]
return wrapper