From 84dda30153a2c392d01c4c812ebb2883cf739ea1 Mon Sep 17 00:00:00 2001 From: ShwethaHP Date: Thu, 23 Nov 2017 02:53:52 +0530 Subject: Fixing the glusto-tests Build Failures: 21:00:43 ./glustolibs-gluster/glustolibs/gluster/lib_utils.py:67:5: E722 do not use bare except' 21:00:43 ./glustolibs-gluster/glustolibs/gluster/lib_utils.py:290:5: E722 do not use bare except' 21:00:43 ./glustolibs-io/shared_files/scripts/file_dir_ops.py:308:13: E722 do not use bare except' 21:00:43 ./glustolibs-io/shared_files/scripts/file_dir_ops.py:316:13: E722 do not use bare except' Change-Id: Ia0babf3d5a10b19c48425e4fcbcb8e79eea5e391 Signed-off-by: ShwethaHP --- glustolibs-io/shared_files/scripts/file_dir_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glustolibs-io') diff --git a/glustolibs-io/shared_files/scripts/file_dir_ops.py b/glustolibs-io/shared_files/scripts/file_dir_ops.py index 8d5b8c488..5bcc422ef 100755 --- a/glustolibs-io/shared_files/scripts/file_dir_ops.py +++ b/glustolibs-io/shared_files/scripts/file_dir_ops.py @@ -305,7 +305,7 @@ def _create_files(dir_path, num_of_files, fixed_file_size=None, for x in range(file_size))) document.add_paragraph(file_str) document.save(fname_abs_path) - except: + except Exception as e: print ("Unable to write to file '%s' : %s" % (fname_abs_path, e.strerror)) rc = 1 @@ -313,7 +313,7 @@ def _create_files(dir_path, num_of_files, fixed_file_size=None, try: with open(fname_abs_path, "w+") as fd: fd.close() - except: + except IOError as e: print ("Unable to write to file '%s' : %s" % (fname_abs_path, e.strerror)) rc = 1 -- cgit