test-log-collect.sh: Fix log collection for host

The lxc_cmd variable is being set when we collect log information for
containers but it is not unset when we do the same thing on the host. As
a result of which, the host repo and pkg logs were wrong since they were
collected from the last container instead of the host.

Change-Id: If2d0a84b46538e44f383967108ca9f67e91f5054
This commit is contained in:
Markos Chandras 2018-05-08 13:45:29 +01:00
parent 0b09a05bd1
commit a6ed5f3dc6
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ COMMON_ETC_LOG_NAMES="apt \
## Functions -----------------------------------------------------------------
function repo_information {
[[ "${1}" != "host" ]] && lxc_cmd="lxc-attach --name ${1} --"
[[ "${1}" != "host" ]] && lxc_cmd="lxc-attach --name ${1} --" || lxc_cmd=""
echo "Collecting list of installed packages and enabled repositories for \"${1}\""
# Redhat package debugging
if eval sudo ${lxc_cmd} which yum &>/dev/null || eval sudo ${lxc_cmd} which dnf &>/dev/null; then