From 8614be683414baf1d9dbbd5ef27a0ea3f6baea82 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Fri, 20 Sep 2019 20:03:21 +0100 Subject: [PATCH] Ensure ss or netstat command is available during log collection Change-Id: I2a10a0462e679a16798c3abf2a0e3f87ed52b40b --- scripts/scripts-library.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index 5349ab3839..3c0b85b3bf 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -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