From 66b81265abd719b1c8dfa9cfb79cc506c245b9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 18 Feb 2016 13:54:24 +0100 Subject: [PATCH] hobo: generate a wscall-secrets section (#10022) --- tests/test_hobo.py | 3 +++ wcs/ctl/check_hobos.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tests/test_hobo.py b/tests/test_hobo.py index 6f3e3b5..e9c20f4 100644 --- a/tests/test_hobo.py +++ b/tests/test_hobo.py @@ -200,6 +200,9 @@ def test_configure_site_options(): assert (pub.get_site_option('authentic.example.net', 'api-secrets') == CmdCheckHobos.shared_secret(HOBO_JSON['services'][1]['secret_key'], HOBO_JSON['services'][2]['secret_key'])) + assert (pub.get_site_option('authentic.example.net', 'wscall-secrets') + == CmdCheckHobos.shared_secret(HOBO_JSON['services'][1]['secret_key'], + HOBO_JSON['services'][2]['secret_key'])) def test_update_configuration(): service = [x for x in HOBO_JSON.get('services', []) if x.get('service-id') == 'wcs'][0] diff --git a/wcs/ctl/check_hobos.py b/wcs/ctl/check_hobos.py index 7c75d35..894ba2c 100644 --- a/wcs/ctl/check_hobos.py +++ b/wcs/ctl/check_hobos.py @@ -319,8 +319,12 @@ class CmdCheckHobos(Command): if not 'api-secrets' in config.sections(): config.add_section('api-secrets') + if not 'wscall-secrets' in config.sections(): + config.add_section('wscall-secrets') for key, value in api_secrets.items(): config.set('api-secrets', key, value) + # for now the secrets are the same whatever the direction is. + config.set('wscall-secrets', key, value) # add known services for service in self.all_services.get('services', []): -- 2.7.0