From 8cbeee740adbb6f24604f0151ecbbc9dcdd63e78 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 5 Jul 2017 19:03:32 +0100 Subject: [PATCH] Handle configuration dump failures in host configure --- kayobe/cli/commands.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index ccf6ba481..cab2581d5 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -250,6 +250,10 @@ class SeedHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, self.app.LOG.debug("Configuring seed host OS") ansible_user = self.run_kayobe_config_dump( parsed_args, host="seed", var_name="kayobe_ansible_user") + if not ansible_user: + self.app.LOG.error("Could not determine kayobe_ansible_user " + "variable for seed host") + sys.exit(1) playbooks = _build_playbook_list( "ip-allocation", "ssh-known-host", "kayobe-ansible-user") if parsed_args.wipe_disks: @@ -376,7 +380,11 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, def take_action(self, parsed_args): self.app.LOG.debug("Configuring overcloud host OS") ansible_user = self.run_kayobe_config_dump( - parsed_args, var_name="kayobe_ansible_user") + parsed_args, hosts="overcloud", var_name="kayobe_ansible_user") + if not ansible_user: + self.app.LOG.error("Could not determine kayobe_ansible_user " + "variable for overcloud hosts") + sys.exit(1) ansible_user = ansible_user.values()[0] playbooks = _build_playbook_list( "ip-allocation", "ssh-known-host", "kayobe-ansible-user")