11 with open(env.ENV.CONFIG_FUNCTEST_YAML) as f:
12 self.functest_yaml = yaml.safe_load(f)
13 self._parse(None, self.functest_yaml)
14 except Exception as error:
15 raise Exception('Parse config failed: {}'.format(str(error)))
18 def _parse(self, attr_now, left_parametes):
19 for param_n, param_v in left_parametes.iteritems():
20 attr_further = self._get_attr_further(attr_now, param_n)
22 self.__setattr__(attr_further, param_v)
23 if isinstance(param_v, dict):
24 self._parse(attr_further, param_v)
26 def _get_attr_further(self, attr_now, next):
27 return attr_now if next == 'general' else (
28 '{}_{}'.format(attr_now, next) if attr_now else next)
30 def _set_others(self):
31 self.env_active = os.path.join(self.dir_functest_conf, "env_active")
36 if __name__ == "__main__":
37 print CONF.vnf_cloudify_ims
38 print CONF.vnf_cloudify_ims_tenant_images
39 print CONF.vnf_cloudify_ims_tenant_images_centos_7