without namespace

This commit is contained in:
egarette@silique.fr 2023-08-23 22:45:19 +02:00
parent 7056e9b361
commit 7fe8393c67

View file

@ -39,7 +39,10 @@ class Annotator(Walk):
# construct self.globals, self.suppliers and self.providers dictionnaries
provider_prefix, provider_suffix = self._cut_out_provider_name(provider_name)
if variable.path_prefix:
dns = self.objectspace.space.variables[variable.path_prefix].doc
else:
dns = "example.net"
if provider_prefix == 'global':
if type_ == 'supplier':
raise DictConsistencyError(f'{type_} {provider_name} in {dns} not allowed', 0, variable.xmlfiles)
@ -78,7 +81,10 @@ class Annotator(Walk):
# it's a reverse provider!
continue
if provider_prefix != 'Host':
if 'risotto_globals' in self.objectspace.rougailconfig:
provider_zone = self.objectspace.rougailconfig['risotto_globals'][provider_dns]['global:provider_zone']
else:
provider_zone = ['zone1']
if provider_prefix not in self.suppliers:
continue
for supplier_dns, suppliers_suffix in self.suppliers[provider_prefix].items():
@ -226,9 +232,13 @@ class Annotator(Walk):
"""Convert providers global informations to default values or fills
"""
provider_prefix = 'global'
if not provider_prefix in self.globals:
return
for provider_dns, providers_suffix in self.globals[provider_prefix].items():
for provider_suffix, variable in providers_suffix.items():
provider_name = f'{provider_prefix}:{provider_suffix}'
if 'risotto_globals' not in self.objectspace.rougailconfig:
continue
if provider_name not in self.objectspace.rougailconfig['risotto_globals'][provider_dns]:
raise DictConsistencyError(f'cannot find {provider_name} for variable {variable.path}, should be in {list(self.objectspace.rougailconfig["risotto_globals"][provider_dns])}', 0, variable.xmlfiles)
provider_values = self.objectspace.rougailconfig['risotto_globals'][provider_dns][provider_name]