diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-02-20 14:32:29 +0800 |
---|---|---|
committer | Serena Feng <feng.xiaowei@zte.com.cn> | 2017-02-21 03:09:59 +0000 |
commit | a2567392d367889f2fd2bb464ce8b05bce12eb0c (patch) | |
tree | 2fabbca4f7779d6695d8fa0f932f6ffb6a6daee1 /utils/test/testapi/opnfv_testapi/resources/pod_handlers.py | |
parent | 47a6e089bb716dddf7bd2aad0c5a9e389d543156 (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/resources/pod_handlers.py')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/resources/pod_handlers.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py b/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py index e1bd9d359..65c27f60a 100644 --- a/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/pod_handlers.py @@ -6,17 +6,17 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +import handlers +from opnfv_testapi.common import constants from opnfv_testapi.tornado_swagger import swagger -from handlers import GenericApiHandler -from pod_models import Pod -from opnfv_testapi.common.constants import HTTP_FORBIDDEN +import pod_models -class GenericPodHandler(GenericApiHandler): +class GenericPodHandler(handlers.GenericApiHandler): def __init__(self, application, request, **kwargs): super(GenericPodHandler, self).__init__(application, request, **kwargs) self.table = 'pods' - self.table_cls = Pod + self.table_cls = pod_models.Pod class PodCLHandler(GenericPodHandler): @@ -46,7 +46,7 @@ class PodCLHandler(GenericPodHandler): def error(data): message = '{} already exists as a pod'.format(data.name) - return HTTP_FORBIDDEN, message + return constants.HTTP_FORBIDDEN, message miss_checks = ['name'] db_checks = [(self.table, False, query, error)] |