[devstack] python-inventoryclient utility in stx-metal

Install and cleanup python-inventoryclient

Task: 29246
Story: 2003161

Depends-on: https://review.openstack.org/#/c/641894/

Change-Id: I9ad9cbba78647044d42859e94b82ce71c23da5e2
Signed-off-by: Martin, Chen <haochuan.z.chen@intel.com>
changes/17/642617/8
Martin, Chen 4 years ago
parent e2e77157dc
commit 9af70ae48e
  1. 1
      .zuul.yaml
  2. 38
      devstack/lib/stx-metal

@ -45,6 +45,7 @@
inventory-api: true
inventory-conductor: true
inventory-agent: true
inventory-client: true
fsmon: true
hbs: true
hwmon: true

@ -107,6 +107,14 @@ function build_inventory {
popd
}
function build_inventory_client {
pushd ${STX_METAL_DIR}/python-inventoryclient/inventoryclient
python setup.py build
popd
}
function install_metal {
install_mtce_common
# components could be seperately installed if
@ -126,6 +134,9 @@ function install_metal {
if is_service_enabled inventory-api || is_service_enabled inventory-conductor || is_service_enabled inventory-agent; then
install_inventory
fi
if is_service_enabled inventory-client; then
install_inventory_client
fi
}
function install_mtce_common {
@ -278,6 +289,24 @@ function install_inventory {
popd
}
function install_inventory_client {
pushd ${STX_METAL_DIR}/python-inventoryclient/inventoryclient
build_inventory_client
sudo python setup.py install \
--root=/ \
--install-lib=$PYTHON_SITE_DIR \
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
sudo install -d -m 755 /etc/bash_completion.d/
sudo install -p -D -m 664 tools/inventory.bash_completion /etc/bash_completion.d/inventory.bash_completion
popd
}
function install_mtce_storage {
local sysconf_dir=${SYSCONFDIR}
local unit_dir=${SYSCONFDIR}/systemd/system
@ -940,6 +969,9 @@ function cleanup_metal {
if is_service_enabled inventory-api || is_service_enabled inventory-conductor || is_service_enabled inventory-agent; then
cleanup_inventory
fi
if is_service_enabled inventory-client; then
cleanup_inventory_client
fi
}
function cleanup_inventory {
@ -964,6 +996,12 @@ function cleanup_inventory {
sudo rm -rf ${unit_dir}/inventory-conductor.service
}
function cleanup_inventory_client {
sudo pip uninstall -y inventoryclient
sudo rm -rf /etc/bash_completion.d/inventory.bash_completion
}
function uninstall_files {
local dest_dir=$1
local dest_file_array=($2)

Loading…
Cancel
Save