summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/common/config.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-02-20 14:32:29 +0800
committerSerena Feng <feng.xiaowei@zte.com.cn>2017-02-21 03:09:59 +0000
commita2567392d367889f2fd2bb464ce8b05bce12eb0c (patch)
tree2fabbca4f7779d6695d8fa0f932f6ffb6a6daee1 /utils/test/testapi/opnfv_testapi/common/config.py
parent47a6e089bb716dddf7bd2aad0c5a9e389d543156 (diff)
fix violation of import rule in TestAPI
TestAPI violate import rule of OpenStack Style a lot, like Do not import objects, only modules Do not import more than one module per line Alphabetically order your imports by the full module path This patch is mean to fix them. Change-Id: Ia05b944a74b3f443c9101a9840f613f9a6f5ae49 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/common/config.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/common/config.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/utils/test/testapi/opnfv_testapi/common/config.py b/utils/test/testapi/opnfv_testapi/common/config.py
index ecab88ae3..82d9c4de6 100644
--- a/utils/test/testapi/opnfv_testapi/common/config.py
+++ b/utils/test/testapi/opnfv_testapi/common/config.py
@@ -7,9 +7,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
# feng.xiaowei@zte.com.cn remove prepare_put_request 5-30-2016
##############################################################################
-
-
-from ConfigParser import SafeConfigParser, NoOptionError
+import ConfigParser
class ParseError(Exception):
@@ -42,7 +40,7 @@ class APIConfig:
def _get_parameter(self, section, param):
try:
return self._parser.get(section, param)
- except NoOptionError:
+ except ConfigParser.NoOptionError:
raise ParseError("[%s.%s] parameter not found" % (section, param))
def _get_int_parameter(self, section, param):
@@ -68,7 +66,7 @@ class APIConfig:
if config_location is None:
config_location = obj._default_config_location
- obj._parser = SafeConfigParser()
+ obj._parser = ConfigParser.SafeConfigParser()
obj._parser.read(config_location)
if not obj._parser:
raise ParseError("%s not found" % config_location)