From f1dec639de47c632ebcf9acc4f7e74ed57979a6f Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 17 May 2017 07:44:27 +0200 Subject: Conform constants.py with the minimal standards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It adds the shebang to constants.py and its dependencies and stops importing from a relative path. It stops printing obsolete values too. It adds python3 support to them by the way. Change-Id: Ie7bddcf253eb245844d9e11c17acc69943c1ba63 Signed-off-by: Cédric Ollivier --- functest/utils/constants.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) mode change 100755 => 100644 functest/utils/constants.py (limited to 'functest/utils/constants.py') diff --git a/functest/utils/constants.py b/functest/utils/constants.py old mode 100755 new mode 100644 index 2e8eb3f44..75c97c765 --- a/functest/utils/constants.py +++ b/functest/utils/constants.py @@ -1,20 +1,17 @@ -import config -import env +#!/usr/bin/env python + +import six + +from functest.utils import config +from functest.utils import env class Constants(object): def __init__(self): - for attr_n, attr_v in config.CONF.__dict__.iteritems(): + for attr_n, attr_v in six.iteritems(config.CONF.__dict__): self.__setattr__(attr_n, attr_v) - for env_n, env_v in env.ENV.__dict__.iteritems(): + for env_n, env_v in six.iteritems(env.ENV.__dict__): self.__setattr__(env_n, env_v) CONST = Constants() - -if __name__ == '__main__': - print CONST.__dict__ - print CONST.NODE_NAME - print CONST.vIMS_clearwater_blueprint_url - print CONST.vIMS_clearwater_blueprint_file_name - print CONST.vIMS_clearwater_blueprint_name -- cgit 1.2.3-korg