Fix os_cmd script for tty

Add the '-1' parameter to lxc-ls so each container is listed on a
single line, otherwise multiple container names were being listed
on a single line and causing the command to fail when in a tty.

Also use the '--filter' parameter to return only the utility
containers rather than having lxc-ls process and return each
container.

Change-Id: Ifcf1f13392d17464a088ce2928f434387ca39365
This commit is contained in:
Kyle L. Henderson 2017-05-16 13:08:39 -05:00
parent c78faa84ce
commit 16127335f4

View File

@ -47,7 +47,7 @@ __check_cmd_avail ${LXCATTACH}
__check_cmd_avail ${LXCLS}
# Find the first utility container to execute in
UTIL=$(${LXCLS} | grep utility | head -n 1)
UTIL=$(${LXCLS} -1 --filter utility | head -n 1)
if [ "z${UTIL}" == "z" ]; then
echo "*** Couldn't find a utility container. Exiting..."
exit 1