FFDC code fix using pyflake
Changes:
- Fixed the following error
ffdc/ffdc_collector.py:56:9:
local variable 'e' is assigned to but never used
ffdc/ffdc_collector.py:913:21: undefined name 'self'
ffdc/ffdc_collector.py:918:21: undefined name 'self'
ffdc/ffdc_collector.py:1356:9:
local variable 'env_vars_list' is assigned to but never used
ffdc/lib/ssh_utility.py:67:9:
local variable 'e' is assigned to but never used
ffdc/plugins/redfish.py:8:1: 'os' imported but unused
Tested:
- pyflake ffdc/
- Tested the changes on sandbox
Change-Id: Ib4e774e1e7e16b49a36a5a00e35d6e60b4868715
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/ffdc/ffdc_collector.py b/ffdc/ffdc_collector.py
index 6044e5e..c99873f 100644
--- a/ffdc/ffdc_collector.py
+++ b/ffdc/ffdc_collector.py
@@ -54,6 +54,7 @@
try:
plugin = __import__(plugin_module, globals(), locals(), [], 0)
except Exception as e:
+ print("PLUGIN: Exception: %s" % e)
print("PLUGIN: Module import failed: %s" % module)
pass
except FileNotFoundError as e:
@@ -910,12 +911,12 @@
except (IOError, OSError) as e:
# PermissionError
if e.errno == EPERM or e.errno == EACCES:
- self.logger.error(
+ print(
"\tERROR: os.makedirs %s failed with"
" PermissionError.\n" % dir_path
)
else:
- self.logger.error(
+ print(
"\tERROR: os.makedirs %s failed with %s.\n"
% (dir_path, e.strerror)
)
@@ -1353,7 +1354,6 @@
yaml_arg_list: [arg2, arg2]
"""
# Get the env loaded keys as list ['hostname', 'username', 'password'].
- env_vars_list = list(self.env_dict)
if isinstance(yaml_arg_list, list):
tmp_list = []