diff -uNr a/heartbeat/nova-compute-wait b/heartbeat/nova-compute-wait --- a/heartbeat/nova-compute-wait 2016-05-13 11:50:54.434532591 +0200 +++ b/heartbeat/nova-compute-wait 2016-05-13 12:04:41.997856291 +0200 @@ -52,34 +52,25 @@ - -Authorization URL for connecting to keystone in admin context - -Authorization URL +Deprecated - do not use anymore. +Deprecated - do not use anymore - -Username for connecting to keystone in admin context - -Username +Deprecated - do not use anymore. +Deprecated - do not use anymore - -Password for connecting to keystone in admin context - -Password +Deprecated - do not use anymore. +Deprecated - do not use anymore - -Tenant name for connecting to keystone in admin context. -Note that with Keystone V3 tenant names are only unique within a domain. - -Tenant name +Deprecated - do not use anymore. +Deprecated - do not use anymore @@ -92,18 +83,14 @@ - -Nova API location (internal, public or admin URL) - -Nova API location (internal, public or admin URL) +Deprecated - do not use anymore. +Deprecated - do not use anymore - -Disable shared storage recovery for instances. Use at your own risk! - -Disable shared storage recovery for instances +Deprecated - do not use anymore. +Deprecated - do not use anymore @@ -186,9 +173,8 @@ nova_validate() { rc=$OCF_SUCCESS - fence_options="" - check_binary openstack-config + check_binary crudini check_binary nova-compute if [ ! -f /etc/nova/nova.conf ]; then @@ -196,81 +182,14 @@ exit $OCF_ERR_CONFIGURED fi - if [ -z "${OCF_RESKEY_auth_url}" ]; then - ocf_exit_reason "auth_url not configured" - exit $OCF_ERR_CONFIGURED - fi - - fence_options="${fence_options} -k ${OCF_RESKEY_auth_url}" - - if [ -z "${OCF_RESKEY_username}" ]; then - ocf_exit_reason "username not configured" - exit $OCF_ERR_CONFIGURED - fi - - fence_options="${fence_options} -l ${OCF_RESKEY_username}" - - if [ -z "${OCF_RESKEY_password}" ]; then - ocf_exit_reason "password not configured" - exit $OCF_ERR_CONFIGURED - fi - - fence_options="${fence_options} -p ${OCF_RESKEY_password}" - - if [ -z "${OCF_RESKEY_tenant_name}" ]; then - ocf_exit_reason "tenant_name not configured" - exit $OCF_ERR_CONFIGURED - fi - - fence_options="${fence_options} -t ${OCF_RESKEY_tenant_name}" - - if [ -n "${OCF_RESKEY_domain}" ]; then - fence_options="${fence_options} -d ${OCF_RESKEY_domain}" - fi - - if [ -n "${OCF_RESKEY_no_shared_storage}" ]; then - if ocf_is_true "${OCF_RESKEY_no_shared_storage}"; then - fence_options="${fence_options} --no-shared-storage" - fi - fi - - if [ -n "${OCF_RESKEY_endpoint_type}" ]; then - case ${OCF_RESKEY_endpoint_type} in - adminURL|publicURL|internalURL) ;; - *) - ocf_exit_reason "endpoint_type ${OCF_RESKEY_endpoint_type} not valid. Use adminURL or publicURL or internalURL" - exit $OCF_ERR_CONFIGURED - ;; - esac - fence_options="${fence_options} -e ${OCF_RESKEY_endpoint_type}" - fi - - # we take a chance here and hope that host is either not configured - # or configured in nova.conf - - NOVA_HOST=$(openstack-config --get /etc/nova/nova.conf DEFAULT host 2>/dev/null) + NOVA_HOST=$(crudini --get /etc/nova/nova.conf DEFAULT host 2>/dev/null) if [ $? = 1 ]; then - if [ "x${OCF_RESKEY_domain}" != x ]; then - NOVA_HOST=$(uname -n | awk -F. '{print $1}') - else - NOVA_HOST=$(uname -n) - fi - fi - - # We only need to check a configured value, calculated ones are fine - openstack-config --get /etc/nova/nova.conf DEFAULT host 2>/dev/null - if [ $? = 0 ]; then - if [ "x${OCF_RESKEY_domain}" != x ]; then - short_host=$(uname -n | awk -F. '{print $1}') - if [ "x$NOVA_HOST" != "x${short_host}" ]; then - ocf_exit_reason "Invalid Nova host name, must be ${short_host} in order for instance recovery to function" - rc=$OCF_ERR_CONFIGURED - fi - - elif [ "x$NOVA_HOST" != "x$(uname -n)" ]; then - ocf_exit_reason "Invalid Nova host name, must be $(uname -n) in order for instance recovery to function" - rc=$OCF_ERR_CONFIGURED - fi + short_host=$(uname -n | awk -F. '{print $1}') + if [ "x${OCF_RESKEY_domain}" != x ]; then + NOVA_HOST=${short_host}.${OCF_RESKEY_domain} + else + NOVA_HOST=$(uname -n) + fi fi if [ $rc != $OCF_SUCCESS ]; then