From 872c66ffe1c8b4d0224dd8737f1a56845851fbd8 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 18 Dec 2015 23:15:19 +0100 Subject: [PATCH] check_hobos: add --redeploy option (#8894) --- wcs/ctl/check_hobos.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wcs/ctl/check_hobos.py b/wcs/ctl/check_hobos.py index d2d8119..5e8c8c7 100644 --- a/wcs/ctl/check_hobos.py +++ b/wcs/ctl/check_hobos.py @@ -42,9 +42,23 @@ class CmdCheckHobos(Command): Command.__init__(self, [ make_option('--ignore-timestamp', action='store_true', dest='ignore_timestamp', default=False), + make_option('--redeploy', action='store_true', default=False), ]) def execute(self, base_options, sub_options, args): + if sub_options.redeploy: + sub_options.ignore_timestamp = True + for tenant in os.listdir(WcsPublisher.APP_DIR): + hobo_json_path = os.path.join(tenant, 'hobo.json') + if not os.path.exists(hobo_json_path): + continue + hobo_json = json.load(open(hobo_json_path)) + me = [service for service in hobo_json['services'] if service['this'] is True][0] + self.deploy(base_options, sub_options, [me['base_url'], hobo_json_path]) + else: + self.deploy(base_options, sub_options, args) + + def deploy(self, base_options, sub_options, args): import publisher self.base_options = base_options -- 2.1.4