#!/bin/sh set -e action=$1 version=$2 . /usr/share/debconf/confmodule XENAPI_FILE=/etc/nova/nova-compute-xen.conf # Find already existing configuration values from the config file if [ -e ${XENAPI_FILE} ] ; then if grep -E -q "^[- \t]*xenapi_connection_url=" ${XENAPI_FILE} ; then XENAPI_URL=`grep -E "^[- \t]*xenapi_connection_url=" ${XENAPI_FILE} | cut -d"=" -f2` db_set nova-compute-xen/xenapi_url ${XENAPI_URL} fi if grep -E -q "^[- \t]*xenapi_connection_username=" ${XENAPI_FILE} ; then XENAPI_USERNAME=`grep -E "^[- \t]*xenapi_connection_username=" ${XENAPI_FILE} | cut -d"=" -f2` db_set nova-compute-xen/xenapi_username ${XENAPI_USERNAME} fi if grep -E -q "^[- \t]*xenapi_connection_password=" ${XENAPI_FILE} ; then XENAPI_PASSWORD=`grep -E "^[- \t]*xenapi_connection_password=" ${XENAPI_FILE} | cut -d"=" -f2` db_set nova-compute-xen/xenapi_password ${XENAPI_PASSWORD} fi fi db_input high nova-compute-xen/xenapi_url || true db_input high nova-compute-xen/xenapi_username || true db_input high nova-compute-xen/xenapi_password || true db_go exit 0