hobo: give cubes a slug (#38596)

This also reverts commit 3e956befb4,
which was buggy since new is file scoped and cubes_slug config-section
scoped.
This commit is contained in:
Valentin Deniaud 2019-12-17 17:55:46 +01:00
parent 126ddfa812
commit d305de24fe
1 changed files with 2 additions and 4 deletions

View File

@ -36,8 +36,6 @@ class Command(hobo_deploy.Command):
config = ConfigParser.ConfigParser()
config.read(ini_file)
new = not(os.path.exists(ini_file))
if not os.path.exists(schemas_path):
os.mkdir(schemas_path)
if not config.has_section('wcs-olap'):
@ -84,7 +82,7 @@ class Command(hobo_deploy.Command):
config.set(base_url, 'key', key)
config.set(base_url, 'schema', schema)
config.set(base_url, 'cubes_label', service.get('title').encode('utf-8'))
if new:
config.set(base_url, 'cubes_slug', service.get('slug'))
if 'slug' in service:
config.set(base_url, 'cubes_slug', service['slug'])
with open(ini_file, 'w') as f:
config.write(f)