Ignore return code in lxc.attachable

This prevents spurious error logging.
This commit is contained in:
Erik Johnson 2015-05-15 14:53:07 -05:00
parent 08658c0177
commit b4c48e62ea

View file

@ -2838,8 +2838,12 @@ def attachable(name):
_ensure_exists(name)
# Can't use run() here because it uses attachable() and would
# endlessly recurse, resulting in a traceback
log.debug('Checking if LXC container {0} is attachable'.format(name))
cmd = 'lxc-attach --clear-env -n {0} -- /usr/bin/env'.format(name)
result = __salt__['cmd.retcode'](cmd, python_shell=False) == 0
result = __salt__['cmd.retcode'](cmd,
python_shell=False,
output_loglevel='quiet',
ignore_retcode=True) == 0
__context__['lxc.attachable'] = result
return __context__['lxc.attachable']