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
(cherry picked from commit a6ed5f3dc6)
This commit is contained in:
Markos Chandras 2018-05-08 13:45:29 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 93dc5b2f65
commit daefb0a00a
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,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