summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-04-28 13:02:16 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-01 12:23:01 (GMT)
commitbce3046097b9f0b760225f28d5b268b006124145 (patch)
tree8055ad40765669222f90bfdc495afb3298989e49
parent238cc03efc245e3ced3aca4c7280385365e1ac6d (diff)
downloaddefinitions-bce3046097b9f0b760225f28d5b268b006124145.tar.gz
openstack: improve nova configuration extension
Change-Id: Ibc0b20feb13848d73dbc2ce5836efe565bc3381b
-rw-r--r--openstack-nova.configure68
1 files changed, 25 insertions, 43 deletions
diff --git a/openstack-nova.configure b/openstack-nova.configure
index 4e30d93..213f185 100644
--- a/openstack-nova.configure
+++ b/openstack-nova.configure
@@ -23,29 +23,35 @@ enable(){
"$ROOT/etc/systemd/system/multi-user.target.wants/openstack-nova-$1.service"
}
+unnaceptable(){
+ eval echo Unexpected value \$$1 for $1 >&2
+ exit 1
+}
+
+check_bool(){
+ case "$(eval echo \"\$$1\")" in
+ True|'')
+ eval "$1=true"
+ ;;
+ False)
+ eval "$1=false"
+ ;;
+ *)
+ unnaceptable "$1"
+ ;;
+ esac
+}
+
##########################################################################
# Check variables
##########################################################################
-if [ -z "$NOVA_SERVICE_USER" -a \
- -z "$NOVA_SERVICE_PASSWORD" -a \
- -z "$NOVA_DB_USER" -a \
- -z "$NOVA_DB_PASSWORD" -a \
- -z "$NOVA_VIRT_TYPE" -a \
- -z "$NEUTRON_SERVICE_USER" -a \
- -z "$NEUTRON_SERVICE_PASSWORD" -a \
- -z "$IRONIC_SERVICE_USER" -a \
- -z "$IRONIC_SERVICE_PASSWORD" -a \
- -z "$METADATA_PROXY_SHARED_SECRET" -a \
- -z "$RABBITMQ_HOST" -a \
- -z "$RABBITMQ_USER" -a \
- -z "$RABBITMQ_PASSWORD" -a \
- -z "$RABBITMQ_PORT" -a \
- -z "$CONTROLLER_HOST_ADDRESS" -a \
- -z "$MANAGEMENT_INTERFACE_IP_ADDRESS" -a \
- -z "$KEYSTONE_TEMPORARY_ADMIN_TOKEN" ]; then
- # No NOVA options defined, do nothing.
- exit 0
+check_bool NOVA_ENABLE_CONTROLLER
+check_bool NOVA_ENABLE_COMPUTE
+
+if ! "$NOVA_ENABLE_CONTROLLER" && \
+ ! "$NOVA_ENABLE_COMPUTE"; then
+ exit 0
fi
if [ -z "$NOVA_SERVICE_USER" -o \
@@ -69,30 +75,6 @@ if [ -z "$NOVA_SERVICE_USER" -o \
exit 1
fi
-# Check optional variables
-
-unnaceptable(){
- eval echo Unexpected value \$$1 for $1 >&2
- exit 1
-}
-
-check_bool(){
- case "$(eval echo \"\$$1\")" in
- True|'')
- eval "$1=true"
- ;;
- False)
- eval "$1=false"
- ;;
- *)
- unnaceptable "$1"
- ;;
- esac
-}
-
-check_bool NOVA_ENABLE_CONTROLLER
-check_bool NOVA_ENABLE_COMPUTE
-
###############################################
# Enable libvirtd and libvirt-guests services #
###############################################