From c6b9accb4fa5acf271afd861620808f9d76919ea Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 7 Mar 2019 10:07:32 -0600 Subject: [PATCH] Updates to include cgtsclient and install dirs fm-rest-api requires cgtsclient, stx-config needed some work to allow only that to be installed. Rework installation dir again. Put everything in /usr/local again, but allow that to be changed to a user-writable dir and not require sudo. Depends-on: https://review.openstack.org/641786 Depends-on: https://review.openstack.org/641783 Depends-on: https://review.openstack.org/641699 Change-Id: I37cc8283e8eb93a77088aebacdcc62dfb7e1c75e Signed-off-by: Dean Troyer --- .zuul.yaml | 9 +++++++-- devstack/lib/stx-fault | 28 +++++++++++++++++----------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index a94604b8..a07ecc67 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -83,18 +83,23 @@ parent: stx-devstack-base timeout: 7800 required-projects: + - name: openstack/stx-config + - name: openstack/stx-integ - name: openstack/stx-update vars: tox_envlist: functional devstack_services: + cgtsclient: true fm-common: true fm-api: true fm-rest-api: true fm-mgr: true devstack_plugins: - stx-update: git://git.starlingx.io/stx-update + stx-config: git://git.starlingx.io/stx-config stx-fault: git://git.starlingx.io/stx-fault + stx-integ: git://git.starlingx.io/stx-integ + stx-update: git://git.starlingx.io/stx-update devstack_localrc: - LIBS_FROM_GIT: cinder,glance,keystone,neutron,nova + LIBS_FROM_GIT: keystone files: - ^devstack/.* diff --git a/devstack/lib/stx-fault b/devstack/lib/stx-fault index 89918664..dcd58e90 100644 --- a/devstack/lib/stx-fault +++ b/devstack/lib/stx-fault @@ -41,8 +41,14 @@ FM_RESTAPI_SERVICE_PORT=${FM_RESTAPI_SERVICE_PORT:-18002} FM_RESTAPI_WORKERS=${FM_RESTAPI_WORKERS:-4} # STX_INST_DIR should be a non-root-writable place to install build artifacts -STX_INST_DIR=${STX_INST_DIR:-$DEST/usr} -STX_BIN_DIR=$STX_INST_DIR/bin +STX_INST_DIR=${STX_INST_DIR:-/usr/local} +STX_BIN_DIR=${STX_BIN_DIR:-$STX_INST_DIR/bin} +STX_SBIN_DIR=${STX_SBIN_DIR:-$STX_INST_DIR/sbin} + +# Set up so we don't use sudo for installs when not necessary +STX_SUDO="sudo" +[[ -w $STX_INST_DIR ]] && STX_SUDO="env" + PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") # Functions @@ -121,7 +127,7 @@ function cleanup_fm_common { pushd $STX_FAULT_DIR/fm-common/sources - make \ + $STX_SUDO make \ DESTDIR=$STX_INST_DIR \ BINDIR=/bin \ LIBDIR=/lib \ @@ -130,7 +136,7 @@ function cleanup_fm_common { MINOR=$minor \ clean - rm $STX_BIN_DIR/fm_db_sync_event_suppression.py \ + $STX_SUDO rm $STX_BIN_DIR/fm_db_sync_event_suppression.py \ $STX_INST_DIR/include/fmConfig.h \ $STX_INST_DIR/include/fmLog.h @@ -147,7 +153,7 @@ function cleanup_fm_mgr { pushd $STX_FAULT_DIR/fm-mgr/sources - make \ + $STX_SUDO make \ DESTDIR=$STX_INST_DIR \ BINDIR=/bin \ MAJOR=$major \ @@ -281,7 +287,7 @@ function install_fm_common { # install to STX_INST_DIR # Note that DESTDIR prefixes the other locations in the Makefile - make \ + $STX_SUDO make \ DESTDIR=$STX_INST_DIR \ BINDIR=/bin \ LIBDIR=/lib \ @@ -297,12 +303,12 @@ function install_fm_common { --install-data=/usr/share \ # This _is_ still a little nasty, clean it up - install -m 755 fm_db_sync_event_suppression.py \ - $STX_INST_DIR/bin/fm_db_sync_event_suppression.py + $STX_SUDO install -m 755 fm_db_sync_event_suppression.py \ + $STX_BIN_DIR/fm_db_sync_event_suppression.py # install the headers that used by fm-mgr package - install -m 644 -p -D fmConfig.h $STX_INST_DIR/include/fmConfig.h - install -m 644 -p -D fmLog.h $STX_INST_DIR/include/fmLog.h + $STX_SUDO install -m 644 -p -D fmConfig.h $STX_INST_DIR/include/fmConfig.h + $STX_SUDO install -m 644 -p -D fmLog.h $STX_INST_DIR/include/fmLog.h # Make sure we can find it later # TODO: this should be managed better @@ -325,7 +331,7 @@ function install_fm_mgr { # install to STX_INST_DIR # Note that DESTDIR prefixes the other locations in the Makefile - make \ + $STX_SUDO make \ DESTDIR=$STX_INST_DIR \ BINDIR=/bin \ MAJOR=$major \