X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Fopnfv_tests%2Fopenstack%2Frefstack_client%2Ftempest_conf.py;h=fbaad589e338870a8b0dbe26d1564a28f9cde269;hb=ac816628995c1e017f12ba23435ae07d24ceecac;hp=5624ed79bf3c4ee17f0b65f1920622000b6c5818;hpb=59c4371997e1a8eaaf1df090ca1d5d90956fdb81;p=functest.git diff --git a/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py b/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py index 5624ed79b..fbaad589e 100755 --- a/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py +++ b/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py @@ -5,16 +5,15 @@ # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 -import sys +import logging +import os -from functest.core import testcase from functest.opnfv_tests.openstack.tempest import conf_utils from functest.utils import openstack_utils from functest.utils.constants import CONST -import functest.utils.functest_logger as ft_logger """ logging configuration """ -logger = ft_logger.Logger("refstack_defcore").getLogger() +logger = logging.getLogger(__name__) class TempestConf(object): @@ -25,29 +24,32 @@ class TempestConf(object): self.DEPLOYMENT_ID = conf_utils.get_verifier_deployment_id() self.DEPLOYMENT_DIR = conf_utils.get_verifier_deployment_dir( self.VERIFIER_ID, self.DEPLOYMENT_ID) + self.confpath = os.path.join( + CONST.__getattribute__('dir_functest_test'), + CONST.__getattribute__('refstack_tempest_conf_path')) def generate_tempestconf(self): try: - openstack_utils.source_credentials(CONST.openstack_creds) + openstack_utils.source_credentials( + CONST.__getattribute__('openstack_creds')) img_flavor_dict = conf_utils.create_tempest_resources( use_custom_images=True, use_custom_flavors=True) conf_utils.configure_tempest_defcore( self.DEPLOYMENT_DIR, img_flavor_dict) - except KeyError as e: - logger.error("defcore prepare env error with: %s", e) + except Exception as e: + logger.error("error with generating refstack client " + "reference tempest conf file: %s", e) def main(self): try: self.generate_tempestconf() - res = testcase.TestCase.EX_OK + logger.info("a reference tempest conf file generated " + "at %s", self.confpath) except Exception as e: logger.error('Error with run: %s', e) - res = testcase.TestCase.EX_RUN_ERROR - return res if __name__ == '__main__': + logging.basicConfig() tempestconf = TempestConf() - result = tempestconf.main() - if result != testcase.TestCase.EX_OK: - sys.exit(result) + tempestconf.main()