forked from stove/risotto
without namespace
This commit is contained in:
parent
7056e9b361
commit
7fe8393c67
1 changed files with 12 additions and 2 deletions
|
@ -39,7 +39,10 @@ class Annotator(Walk):
|
||||||
|
|
||||||
# construct self.globals, self.suppliers and self.providers dictionnaries
|
# construct self.globals, self.suppliers and self.providers dictionnaries
|
||||||
provider_prefix, provider_suffix = self._cut_out_provider_name(provider_name)
|
provider_prefix, provider_suffix = self._cut_out_provider_name(provider_name)
|
||||||
|
if variable.path_prefix:
|
||||||
dns = self.objectspace.space.variables[variable.path_prefix].doc
|
dns = self.objectspace.space.variables[variable.path_prefix].doc
|
||||||
|
else:
|
||||||
|
dns = "example.net"
|
||||||
if provider_prefix == 'global':
|
if provider_prefix == 'global':
|
||||||
if type_ == 'supplier':
|
if type_ == 'supplier':
|
||||||
raise DictConsistencyError(f'{type_} {provider_name} in {dns} not allowed', 0, variable.xmlfiles)
|
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!
|
# it's a reverse provider!
|
||||||
continue
|
continue
|
||||||
if provider_prefix != 'Host':
|
if provider_prefix != 'Host':
|
||||||
|
if 'risotto_globals' in self.objectspace.rougailconfig:
|
||||||
provider_zone = self.objectspace.rougailconfig['risotto_globals'][provider_dns]['global:provider_zone']
|
provider_zone = self.objectspace.rougailconfig['risotto_globals'][provider_dns]['global:provider_zone']
|
||||||
|
else:
|
||||||
|
provider_zone = ['zone1']
|
||||||
if provider_prefix not in self.suppliers:
|
if provider_prefix not in self.suppliers:
|
||||||
continue
|
continue
|
||||||
for supplier_dns, suppliers_suffix in self.suppliers[provider_prefix].items():
|
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
|
"""Convert providers global informations to default values or fills
|
||||||
"""
|
"""
|
||||||
provider_prefix = 'global'
|
provider_prefix = 'global'
|
||||||
|
if not provider_prefix in self.globals:
|
||||||
|
return
|
||||||
for provider_dns, providers_suffix in self.globals[provider_prefix].items():
|
for provider_dns, providers_suffix in self.globals[provider_prefix].items():
|
||||||
for provider_suffix, variable in providers_suffix.items():
|
for provider_suffix, variable in providers_suffix.items():
|
||||||
provider_name = f'{provider_prefix}:{provider_suffix}'
|
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]:
|
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)
|
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]
|
provider_values = self.objectspace.rougailconfig['risotto_globals'][provider_dns][provider_name]
|
||||||
|
|
Loading…
Reference in a new issue