From 21f075faacf0c260c5f4899cd6ba16d369e1b787 Mon Sep 17 00:00:00 2001 From: zhurong Date: Thu, 3 Jan 2019 10:46:26 +0800 Subject: [PATCH] Fix congre command excute error when using python3.6 when test murano python3 in patch [0], murano-congress-devstack failed when excute congress command, error as below: 2018-12-28 05:33:03.601901 | controller | ++ functions-common:oscwrap:2287 : out='openstack: '\''congress datasource create neutronv2 neutronv2 --config poll_time=10 --config username=admin --config tenant_name=admin --config password=secretadmin --config auth_url=http://38.108.68.25/identity'\'' is not an openstack command. See '\''openstack --help'\''. 2018-12-28 05:33:03.601983 | controller | Did you mean one of these? 2018-12-28 05:33:03.602029 | controller | address scope create 2018-12-28 05:33:03.602057 | controller | address scope delete 2018-12-28 05:33:03.602082 | controller | address scope list 2018-12-28 05:33:03.602122 | controller | address scope set 2018-12-28 05:33:03.602149 | controller | address scope show' 2018-12-28 05:33:03.604233 | controller | + functions-common:oscwrap:1 : exit_trap This patch using setup_dev_lib function from devstack install python-congressclient, also this patch add a way to install congresscliet from requirements. [0]: https://review.openstack.org/#/c/624600/ Change-Id: Ifda90653ca515bd5e21e5ed7338ab9fbdacc86ec --- devstack/plugin.sh | 14 ++++++++++++-- devstack/settings | 6 +++--- .../legacy/congress-devstack-api-base/run.yaml | 1 + .../congress-devstack-py35-api-mysql/run.yaml | 1 + .../legacy/congress-pe-replicated-base/run.yaml | 1 + 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 1d9d58610..b7d3ccd1e 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -229,6 +229,16 @@ function init_congress { congress-db-manage --config-file $CONGRESS_CONF upgrade head } +function install_congress_pythonclient() { +# For using non-released client from git branch, need to add +# LIBS_FROM_GIT=python-congressclient parameter to localrc. +# Otherwise, congress will install python-congressclient from requirements. + if use_library_from_git "python-congressclient"; then + git_clone_by_name "python-congressclient" + setup_dev_lib "python-congressclient" + fi +} + # install_congress() - install dependency, collect client source and prepare function install_congress { # congress requires java so we install it here @@ -239,8 +249,8 @@ function install_congress { else die $LINENO "Congress devstack only supports Debian and Red Hat-based" fi - git_clone $CONGRESSCLIENT_REPO $CONGRESSCLIENT_DIR $CONGRESSCLIENT_BRANCH - setup_develop $CONGRESSCLIENT_DIR + + install_congress_pythonclient if is_service_enabled horizon; then _install_congress_dashboard diff --git a/devstack/settings b/devstack/settings index bf98d4870..44c3d5758 100644 --- a/devstack/settings +++ b/devstack/settings @@ -6,7 +6,6 @@ # Set up default directories CONGRESS_DIR=$DEST/congress -CONGRESSCLIENT_DIR=$DEST/python-congressclient CONGRESS_AUTH_CACHE_DIR=${CONGRESS_AUTH_CACHE_DIR:-/var/cache/congress} CONGRESSDASHBOARD_DIR=$DEST/congress-dashboard CONGRESS_Z3_DIR=$DEST/z3 @@ -62,8 +61,9 @@ CONGRESS_REPO=${CONGRESS_REPO:-${GIT_BASE}/openstack/congress.git} CONGRESS_BRANCH=${CONGRESS_BRANCH:-master} # congress client library test -CONGRESSCLIENT_REPO=${CONGRESSCLIENT_REPO:-${GIT_BASE}/openstack/python-congressclient.git} -CONGRESSCLIENT_BRANCH=${CONGRESSCLIENT_BRANCH:-master} +GITREPO["python-congressclient"]=${CONGRESSCLIENT_REPO:-${GIT_BASE}/openstack/python-congressclient.git} +GITBRANCH["python-congressclient"]=${CONGRESSCLIENT_BRANCH:-master} +GITDIR["python-congressclient"]=$DEST/python-congressclient # congress dashboard CONGRESSDASHBOARD_REPO=${CONGRESSDASHBOARD_REPO:-${GIT_BASE}/openstack/congress-dashboard.git} diff --git a/playbooks/legacy/congress-devstack-api-base/run.yaml b/playbooks/legacy/congress-devstack-api-base/run.yaml index 1aab862d2..44ee3fd66 100644 --- a/playbooks/legacy/congress-devstack-api-base/run.yaml +++ b/playbooks/legacy/congress-devstack-api-base/run.yaml @@ -39,6 +39,7 @@ # To deploy congress as multi-process (api, pe, datasources) CONGRESS_MULTIPROCESS_DEPLOYMENT=True CONGRESS_EXPOSE_ENCRYPTION_KEY_FOR_TEST=True + LIBS_FROM_GIT=python-congressclient ENABLE_CONGRESS_Z3=True USE_Z3_RELEASE=4.7.1 TEMPEST_PLUGINS='/opt/stack/new/congress-tempest-plugin /opt/stack/new/telemetry-tempest-plugin /opt/stack/new/murano-tempest-plugin /opt/stack/new/heat-tempest-plugin /opt/stack/new/mistral-tempest-plugin /opt/stack/new/monasca-tempest-plugin' diff --git a/playbooks/legacy/congress-devstack-py35-api-mysql/run.yaml b/playbooks/legacy/congress-devstack-py35-api-mysql/run.yaml index 7e136389d..14134d1b7 100644 --- a/playbooks/legacy/congress-devstack-py35-api-mysql/run.yaml +++ b/playbooks/legacy/congress-devstack-py35-api-mysql/run.yaml @@ -45,6 +45,7 @@ # To deploy congress as multi-process (api, pe, datasources) CONGRESS_MULTIPROCESS_DEPLOYMENT=True CONGRESS_EXPOSE_ENCRYPTION_KEY_FOR_TEST=True + LIBS_FROM_GIT=python-congressclient ENABLE_CONGRESS_Z3=True USE_Z3_RELEASE=4.7.1 TEMPEST_PLUGINS='/opt/stack/new/congress-tempest-plugin /opt/stack/new/murano-tempest-plugin /opt/stack/new/heat-tempest-plugin' diff --git a/playbooks/legacy/congress-pe-replicated-base/run.yaml b/playbooks/legacy/congress-pe-replicated-base/run.yaml index 6331b4f84..6ef8bdebc 100644 --- a/playbooks/legacy/congress-pe-replicated-base/run.yaml +++ b/playbooks/legacy/congress-pe-replicated-base/run.yaml @@ -39,6 +39,7 @@ # To deploy congress as multi-process (api, pe, datasources) CONGRESS_MULTIPROCESS_DEPLOYMENT=True CONGRESS_EXPOSE_ENCRYPTION_KEY_FOR_TEST=True + LIBS_FROM_GIT=python-congressclient TEMPEST_PLUGINS='/opt/stack/new/congress-tempest-plugin /opt/stack/new/telemetry-tempest-plugin /opt/stack/new/murano-tempest-plugin /opt/stack/new/heat-tempest-plugin /opt/stack/new/mistral-tempest-plugin' EOF