Ensure ss or netstat command is available during log collection

Change-Id: I2a10a0462e679a16798c3abf2a0e3f87ed52b40b
This commit is contained in:
Jonathan Rosser 2019-09-20 20:03:21 +01:00
parent e7f82ba7ef
commit 8614be6834
1 changed files with 13 additions and 0 deletions

View File

@ -259,6 +259,19 @@ function info_block {
}
function log_instance_info {
# ensure packages are installed to get instance info
determine_distro
case ${DISTRO_ID} in
ubuntu|debian)
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y install iproute2 net-tools
;;
centos|rhel)
# Prefer dnf over yum for CentOS.
which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum'
$RHT_PKG_MGR -y install iproute
;;
esac
set +x
# Get host information post initial setup and reset verbosity
if [ ! -d "/openstack/log/instance-info" ];then