From d145f98a86f5dd5b11fe46a03fb9b302472d0c04 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Wed, 4 May 2016 15:39:51 +0100 Subject: [PATCH] DevStack: Support to install pyghmi from source This patch is extending the Ironic DevStack plugin to allow pyghmi to be installed from source so we can run ironic jobs against the pyghmi gate. The patch also organizes the setup of VirtualBMC under it's own function. Change-Id: I062df8bef0ccafc551283410b54fa5e9952100a9 --- devstack/lib/ironic | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index f27c697a88..8090d1d6bb 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -33,6 +33,10 @@ set +o pipefail GITDIR["python-ironicclient"]=$DEST/python-ironicclient GITDIR["ironic-lib"]=$DEST/ironic-lib +GITREPO["pyghmi"]=${PYGHMI_REPO:-${GIT_BASE}/openstack/pyghmi.git} +GITBRANCH["pyghmi"]=${PYGHMI_BRANCH:-master} +GITDIR["pyghmi"]=$DEST/pyghmi + IRONIC_DIR=$DEST/ironic IRONIC_DEVSTACK_DIR=$IRONIC_DIR/devstack IRONIC_DEVSTACK_FILES_DIR=$IRONIC_DEVSTACK_DIR/files @@ -261,6 +265,26 @@ function is_deployed_with_ipa_ramdisk { return 1 } +function setup_virtualbmc { + # Install pyghmi from source, if requested, otherwise it will be + # downloaded as part of the virtualbmc installation + if use_library_from_git "pyghmi"; then + git_clone_by_name "pyghmi" + setup_dev_lib "pyghmi" + fi + + # TODO(lucasagomes): Allow virtualbmc to be installed from source + # after the openstack/virtualbmc repository is setup correctly + pip_install "virtualbmc" + + if [[ ! -d $(dirname $IRONIC_VBMC_CONFIG_FILE) ]]; then + mkdir -p $(dirname $IRONIC_VBMC_CONFIG_FILE) + fi + + iniset $IRONIC_VBMC_CONFIG_FILE log debug True + iniset $IRONIC_VBMC_CONFIG_FILE log logfile $IRONIC_VBMC_LOGFILE +} + # install_ironic() - Install the things! function install_ironic { # make sure all needed service were enabled @@ -286,14 +310,7 @@ function install_ironic { fi if is_deployed_by_ipmitool && [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - pip_install "virtualbmc" - - if [[ ! -d $(dirname $IRONIC_VBMC_CONFIG_FILE) ]]; then - mkdir -p $(dirname $IRONIC_VBMC_CONFIG_FILE) - fi - - iniset $IRONIC_VBMC_CONFIG_FILE log debug True - iniset $IRONIC_VBMC_CONFIG_FILE log logfile $IRONIC_VBMC_LOGFILE + setup_virtualbmc fi }