hobo: expose service URLs in template variables (#6645)
This commit is contained in:
parent
a54f3df84d
commit
518fbf01a6
|
@ -160,10 +160,20 @@ class CmdCheckHobos(Command):
|
|||
config.add_section('hobo')
|
||||
config.set('hobo', 'timestamp', self.all_services.get('timestamp'))
|
||||
|
||||
variables = {}
|
||||
for service in self.all_services.get('services', []):
|
||||
variables['%s_url' % service.get('slug')] = service.get('base_url')
|
||||
if self.all_services.get('variables'):
|
||||
for key, value in self.all_services.get('variables').items():
|
||||
variables[key] = value
|
||||
for service in self.all_services.get('services', []):
|
||||
for key, value in service.get('variables', {}).items():
|
||||
variables[key] = value
|
||||
|
||||
if variables:
|
||||
if not 'variables' in config.sections():
|
||||
config.add_section('variables')
|
||||
for key, value in self.all_services.get('variables').items():
|
||||
for key, value in variables.items():
|
||||
config.set('variables', key, value)
|
||||
|
||||
with open(site_options_filepath, 'wb') as site_options:
|
||||
|
|
Loading…
Reference in New Issue