mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Ignore return code in lxc.attachable
This prevents spurious error logging.
This commit is contained in:
parent
08658c0177
commit
b4c48e62ea
1 changed files with 5 additions and 1 deletions
|
@ -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']
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue