summaryrefslogtreecommitdiffstats
path: root/glustolibs-io
diff options
context:
space:
mode:
authorNigel Babu <nigelb@redhat.com>2016-11-16 17:36:15 +0530
committerJonathan Holloway <jholloway@redhat.com>2016-12-12 08:01:33 -0800
commit3070312c13e02cace3041d3429b0c31fc10b73ee (patch)
tree15b202c91c00fd93ab5559bced17b2e7fa27127f /glustolibs-io
parentb7aea27f6662fd5b0344c6dbffcf2b9a86c1f8cc (diff)
Clean up pyflakes and pep8 errors
Change-Id: Ibdd092118d3bb912716c46fd278ef3c680a6e742 Signed-off-by: Nigel Babu <nigelb@redhat.com>
Diffstat (limited to 'glustolibs-io')
-rwxr-xr-xglustolibs-io/shared_files/scripts/fd_writes.py4
-rwxr-xr-xglustolibs-io/shared_files/scripts/file_dir_ops.py11
2 files changed, 7 insertions, 8 deletions
diff --git a/glustolibs-io/shared_files/scripts/fd_writes.py b/glustolibs-io/shared_files/scripts/fd_writes.py
index 0eaf513..ba46a5f 100755
--- a/glustolibs-io/shared_files/scripts/fd_writes.py
+++ b/glustolibs-io/shared_files/scripts/fd_writes.py
@@ -17,7 +17,6 @@
import argparse
import random
-import subprocess
import os
import time
import string
@@ -72,7 +71,7 @@ def create_dir(dir_path):
if not path_exists(dir_abs_path):
try:
os.makedirs(dir_abs_path)
- except (OSError, IOError) as e:
+ except (OSError, IOError):
print "Unable to create dir: %s" % dir_abs_path
return 1
return 0
@@ -190,6 +189,7 @@ def fd_writes(args):
each_process.join()
return 0
+
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Program to perfrom fd based writes on files for time t",
diff --git a/glustolibs-io/shared_files/scripts/file_dir_ops.py b/glustolibs-io/shared_files/scripts/file_dir_ops.py
index e98a660..4216033 100755
--- a/glustolibs-io/shared_files/scripts/file_dir_ops.py
+++ b/glustolibs-io/shared_files/scripts/file_dir_ops.py
@@ -22,7 +22,6 @@
import os
import argparse
import sys
-import time
import random
import string
import datetime
@@ -99,7 +98,7 @@ def create_dir(dir_path):
if not path_exists(dir_abs_path):
try:
os.makedirs(dir_abs_path)
- except (OSError, IOError) as e:
+ except (OSError, IOError):
print "Unable to create dir: %s" % dir_abs_path
return 1
return 0
@@ -208,7 +207,7 @@ def create_deep_dirs_with_files(args):
file_types = args.file_types
try:
fixed_file_size = args.fixed_file_size
- except AttributeError as e:
+ except AttributeError:
fixed_file_size = None
base_file_name = args.base_file_name
dirname_start_num = args.dirname_start_num
@@ -298,7 +297,7 @@ def _create_files(dir_path, num_of_files, fixed_file_size=None,
str_to_write = string.ascii_letters + string.digits
file_str = (''.join(random.choice(str_to_write)
for x in range(file_size)))
- p = document.add_paragraph(file_str)
+ document.add_paragraph(file_str)
document.save(fname_abs_path)
except:
print ("Unable to write to file '%s' : %s" %
@@ -323,7 +322,7 @@ def create_files(args):
num_of_files = args.num_of_files
try:
fixed_file_size = args.fixed_file_size
- except AttributeError as e:
+ except AttributeError:
fixed_file_size = None
base_file_name = args.base_file_name
file_types = args.file_types
@@ -448,7 +447,7 @@ def _get_path_stats(path):
'inode': stat.st_ino,
'stat': stat
})
- except Exception as e:
+ except Exception:
rc = 1
err = "Unable to get the stat of path %s" % path