From 6a29a71266d0f3a01390567ed4fd05033a47319d Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Mon, 21 Mar 2016 19:32:59 +0300 Subject: [PATCH] Fail bootstrap_admin_node if admin password is wrong This covers the scenario where a user changes the admin password, but fails to update /etc/fuel/astute.yaml and /root/.config/fuel/fuel_client.yaml. These files need to be updated to re-run bootstrap_admin_node for simple patching. This fix is partial because it should include string updates in fuel-ui, docs, and fuelclient. Change-Id: I23f362524eab9649b58a8ba722e6fd6cb1d6b1ab Partial-Bug: #1555262 --- iso/bootstrap_admin_node.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/iso/bootstrap_admin_node.sh b/iso/bootstrap_admin_node.sh index d1d0440da..58d61d055 100755 --- a/iso/bootstrap_admin_node.sh +++ b/iso/bootstrap_admin_node.sh @@ -100,7 +100,9 @@ https://docs.mirantis.com/openstack/fuel/fuel-${FUEL_RELEASE}/\ release-notes.html#maintenance-updates" fuelmenu_fail_message="Fuelmenu was not able to generate '/etc/fuel/astute.yaml' file! \ Please, restart it manualy using 'fuelmenu' command." - +fuelclient_fail_message="Fuel CLI credentials are invalid. Update \ +/etc/fuel/astute.yaml FUEL_ACCESS/password and ~/.config/fuel/fuel_client.yaml\ + in order to proceed with deployment." function countdown() { local i sleep 1 @@ -500,6 +502,13 @@ if [ ${old_sysctl_vm_value} -lt 65535 ]; then sysctl -w vm.min_free_kbytes=${old_sysctl_vm_value} fi +# Ensure fuelclient can authenticate +output=$(fuel token 2>&1) +if echo "$output" | grep -q "Unauthorized"; then + echo $fuelclient_fail_message + fail +fi + # apply puppet /etc/puppet/modules/fuel/examples/deploy.sh if [[ $? -ne 0 ]]; then