From 0f7939f4122040b3297339c121883c4e144870bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Mon, 28 Nov 2016 09:46:42 -0500 Subject: [PATCH] Update devstack plugin Requirements have to be changed to avoid conflicts with other projects in devstack. Moreover, all dependencies must be compatible with global and upper OpenStack constraints. Change-Id: Ie925b4481c865f398ac29eadfc58e9bfb18604c9 --- devstack/plugin.sh | 37 ++++++++++++++----------------------- devstack/settings | 1 - requirements.txt | 20 ++++++++++---------- test-requirements.txt | 12 ++++-------- 4 files changed, 28 insertions(+), 42 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 6188103..05580c4 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -27,29 +27,18 @@ function _install_mongodb { function almanach_configure { sudo install -d -o $STACK_USER -m 755 $ALMANACH_CONF_DIR - cp ${ALMANACH_DIR}/almanach/resources/config/almanach.cfg $ALMANACH_CONF - iniset $ALMANACH_CONF ALMANACH auth_token secret - iniset $ALMANACH_CONF ALMANACH auth_strategy private_key - iniset $ALMANACH_CONF ALMANACH volume_existence_threshold 60 - iniset $ALMANACH_CONF ALMANACH device_metadata_whitelist metering.billing_mode + iniset $ALMANACH_CONF DEFAULT debug "True" - iniset $ALMANACH_CONF MONGODB url mongodb://localhost/almanach - iniset $ALMANACH_CONF MONGODB database almanach - iniset $ALMANACH_CONF MONGODB indexes project_id,start,end + iniset $ALMANACH_CONF api bind_ip $ALMANACH_SERVICE_HOST + iniset $ALMANACH_CONF api bind_port $ALMANACH_SERVICE_PORT - iniset $ALMANACH_CONF RABBITMQ url amqp://stackrabbit:secret@localhost:5672 - iniset $ALMANACH_CONF RABBITMQ indexes project_id,start,end - iniset $ALMANACH_CONF RABBITMQ queue almanach.info - iniset $ALMANACH_CONF RABBITMQ exchange almanach.info - iniset $ALMANACH_CONF RABBITMQ routing.key almanach.info - iniset $ALMANACH_CONF RABBITMQ retry.time.to.live 10 - iniset $ALMANACH_CONF RABBITMQ retry.exchange almanach.retry - iniset $ALMANACH_CONF RABBITMQ retry.maximum 3 - iniset $ALMANACH_CONF RABBITMQ retry.queue almanach.retry - iniset $ALMANACH_CONF RABBITMQ retry.return.exchange almanach - iniset $ALMANACH_CONF RABBITMQ dead.queue almanach.dead - iniset $ALMANACH_CONF RABBITMQ dead.exchange almanach.dead + iniset $ALMANACH_CONF auth auth_token secret + iniset $ALMANACH_CONF auth auth_strategy private_key + + iniset $ALMANACH_CONF collector transport_url rabbit://stackrabbit:secret@localhost:5672 + + iniset $ALMANACH_CONF database connection_url mongodb://localhost/almanach } # Create almanach related accounts in Keystone @@ -78,12 +67,14 @@ function install_almanach { } function start_almanach { - run_process almanach-collector "$ALMANACH_BIN_DIR/almanach collector $ALMANACH_CONF" - run_process almanach-api "$ALMANACH_BIN_DIR/almanach api $ALMANACH_CONF --host 0.0.0.0" + run_process almanach-collector "$ALMANACH_BIN_DIR/almanach-collector --config-file $ALMANACH_CONF" + run_process almanach-api "$ALMANACH_BIN_DIR/almanach-api --config-file $ALMANACH_CONF" } function stop_almanach { - echo "todo" + for serv in almanach-api almanach-collector; do + stop_process $serv + done } ALMANACH_BIN_DIR=$(get_python_exec_prefix) diff --git a/devstack/settings b/devstack/settings index 9020601..cbe6dab 100644 --- a/devstack/settings +++ b/devstack/settings @@ -9,4 +9,3 @@ ALMANACH_CONF=$ALMANACH_CONF_DIR/almanach.cfg ALMANACH_SERVICE_PROTOCOL=http ALMANACH_SERVICE_HOST=${ALMANACH_SERVICE_HOST:-${SERVICE_HOST}} ALMANACH_SERVICE_PORT=${ALMANACH_SERVICE_PORT:-8000} - diff --git a/requirements.txt b/requirements.txt index 082434f..1e4251f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,13 @@ -pbr>=1.10.0 -Flask==0.10.1 +pbr>=1.8 # Apache-2.0 +Flask>=0.10,!=0.11,<1.0 # BSD jsonpickle==0.7.1 pymongo>=3.0.2,!=3.1 # Apache-2.0 -pytz>=2014.10 -voluptuous==0.8.11 -python-keystoneclient>=1.6.0 -six>=1.9.0 # MIT -oslo.serialization>=1.10.0 # Apache-2.0 -oslo.config>=3.14.0 # Apache-2.0 +pytz>=2013.6 # MIT +voluptuous>=0.8.9 # BSD License +python-keystoneclient>=3.6.0 # Apache-2.0 +six>=1.9.0 # MIT +oslo.serialization>=1.10.0 # Apache-2.0 +oslo.config>=3.14.0 # Apache-2.0 oslo.log>=3.11.0 # Apache-2.0 -oslo.messaging>=5.2.0 # Apache-2.0 -oslo.service>=1.10.0 # Apache-2.0 \ No newline at end of file +oslo.messaging>=5.2.0 # Apache-2.0 +oslo.service>=1.10.0 # Apache-2.0 \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index 1729c6b..ffd94c6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,15 +1,11 @@ -setuptools==0.9.8 -coverage==3.6b1 -nose==1.2.1 -cov-core==1.7 -nose-cov==1.6 -nose-blockage==0.1.2 flexmock==0.9.4 mongomock==2.0.0 PyHamcrest==1.8.5 +nose # LGPL +setuptools>=16.0,!=24.0.0 # PSF/ZPL sphinx>=1.2.1,!=1.3b1,<1.3 # BSD sphinxcontrib-httpdomain # BSD flake8>=2.5.4,<2.6.0 # MIT -hacking<0.12,>=0.11.0 # Apache-2.0 +hacking<0.12,>=0.11.0 # Apache-2.0 testtools>=1.4.0 # MIT -mock>=2.0 # BSD \ No newline at end of file +mock>=2.0 # BSD \ No newline at end of file