From b901657c5ebed07c0ab373ad09df5c43045ae189 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Tue, 17 Dec 2019 17:55:46 +0100 Subject: [PATCH 1/4] hobo: give cubes a slug (#38596) This also reverts commit 3e956befb40f36f48da78f311467dff9ba3dbf8b, which was buggy since new is file scoped and cubes_slug config-section scoped. --- bijoe/hobo_agent/management/commands/hobo_deploy.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bijoe/hobo_agent/management/commands/hobo_deploy.py b/bijoe/hobo_agent/management/commands/hobo_deploy.py index f2e00a6..1ff8fb8 100644 --- a/bijoe/hobo_agent/management/commands/hobo_deploy.py +++ b/bijoe/hobo_agent/management/commands/hobo_deploy.py @@ -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) -- 2.20.1