summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2018-02-13 21:07:36 -0800
committerEmma Foley <emma.l.foley@intel.com>2018-02-14 10:52:52 +0000
commitf1f059b05efbb4f31be4d82f93e1e901cf68b239 (patch)
tree56a47f7b5a301183de7cceb7f98f05f19cc34fe9
parent3333efb08ae1d4ee92ea5274f847aabfa95e3eec (diff)
constants: fix pylint warnings for OSError
IOError and OSError are the same in Python 3? Anyway we want to ignore ENOENT, not EEXIST JIRA: YARDSTICK-1012 Change-Id: Ia75e41fecce505685745e0099669e45f3e82a1be Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
-rw-r--r--yardstick/common/constants.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py
index 32ed746df..646a1f2ca 100644
--- a/yardstick/common/constants.py
+++ b/yardstick/common/constants.py
@@ -7,9 +7,9 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
from __future__ import absolute_import
-import os
-import errno
+import errno
+import os
from functools import reduce
import pkg_resources
@@ -40,10 +40,8 @@ def get_param(key, default=''):
try:
with open(conf_file) as f:
value = yaml_load(f)
- except IOError:
- pass
- except OSError as e:
- if e.errno != errno.EEXIST:
+ except (IOError, OSError) as e:
+ if e.errno != errno.ENOENT:
raise
else:
CONF.update(value)