From 46f1037fe35bc249dca868b363107bc1bcd70469 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Tue, 19 Dec 2017 09:23:04 +0000 Subject: Improve the way of setting values in CONST Use setattr instead of internal method (__setattr__). It must be completed by patches fixing [1] [2] and [3]. [1] https://jira.opnfv.org/browse/FUNCTEST-930 [2] https://jira.opnfv.org/browse/FUNCTEST-931 [3] https://jira.opnfv.org/browse/FUNCTEST-932 Change-Id: I9558f33f5ed4559b6031d75951d5637c0c0ef8cb Signed-off-by: Linda Wang --- functest/utils/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functest/utils/constants.py') diff --git a/functest/utils/constants.py b/functest/utils/constants.py index cb3ea787..c19e0fc5 100644 --- a/functest/utils/constants.py +++ b/functest/utils/constants.py @@ -12,9 +12,9 @@ class Constants(object): # pylint: disable=too-few-public-methods def __init__(self): for attr_n, attr_v in six.iteritems(config.CONF.__dict__): - self.__setattr__(attr_n, attr_v) + setattr(self, attr_n, attr_v) for env_n, env_v in six.iteritems(env.ENV.__dict__): - self.__setattr__(env_n, env_v) + setattr(self, env_n, env_v) CONST = Constants() -- cgit 1.2.3-korg