summaryrefslogtreecommitdiff
path: root/debian/nova-compute-xen.config
diff options
context:
space:
mode:
Diffstat (limited to 'debian/nova-compute-xen.config')
-rw-r--r--debian/nova-compute-xen.config32
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/nova-compute-xen.config b/debian/nova-compute-xen.config
new file mode 100644
index 0000000..158e78f
--- /dev/null
+++ b/debian/nova-compute-xen.config
@@ -0,0 +1,32 @@
+#!/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