[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>
This commit is contained in:
parent
e2e77157dc
commit
9af70ae48e
|
@ -45,6 +45,7 @@
|
||||||
inventory-api: true
|
inventory-api: true
|
||||||
inventory-conductor: true
|
inventory-conductor: true
|
||||||
inventory-agent: true
|
inventory-agent: true
|
||||||
|
inventory-client: true
|
||||||
fsmon: true
|
fsmon: true
|
||||||
hbs: true
|
hbs: true
|
||||||
hwmon: true
|
hwmon: true
|
||||||
|
|
|
@ -107,6 +107,14 @@ function build_inventory {
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build_inventory_client {
|
||||||
|
pushd ${STX_METAL_DIR}/python-inventoryclient/inventoryclient
|
||||||
|
|
||||||
|
python setup.py build
|
||||||
|
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
function install_metal {
|
function install_metal {
|
||||||
install_mtce_common
|
install_mtce_common
|
||||||
# components could be seperately installed if
|
# 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
|
if is_service_enabled inventory-api || is_service_enabled inventory-conductor || is_service_enabled inventory-agent; then
|
||||||
install_inventory
|
install_inventory
|
||||||
fi
|
fi
|
||||||
|
if is_service_enabled inventory-client; then
|
||||||
|
install_inventory_client
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_mtce_common {
|
function install_mtce_common {
|
||||||
|
@ -278,6 +289,24 @@ function install_inventory {
|
||||||
popd
|
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 {
|
function install_mtce_storage {
|
||||||
local sysconf_dir=${SYSCONFDIR}
|
local sysconf_dir=${SYSCONFDIR}
|
||||||
local unit_dir=${SYSCONFDIR}/systemd/system
|
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
|
if is_service_enabled inventory-api || is_service_enabled inventory-conductor || is_service_enabled inventory-agent; then
|
||||||
cleanup_inventory
|
cleanup_inventory
|
||||||
fi
|
fi
|
||||||
|
if is_service_enabled inventory-client; then
|
||||||
|
cleanup_inventory_client
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_inventory {
|
function cleanup_inventory {
|
||||||
|
@ -964,6 +996,12 @@ function cleanup_inventory {
|
||||||
sudo rm -rf ${unit_dir}/inventory-conductor.service
|
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 {
|
function uninstall_files {
|
||||||
local dest_dir=$1
|
local dest_dir=$1
|
||||||
local dest_file_array=($2)
|
local dest_file_array=($2)
|
||||||
|
|
Loading…
Reference in New Issue