def attachable(name, path=None):
 cachekey = 'lxc.attachable{0}{1}'.format(name, path)
 try:
  return __context__[cachekey]
 except KeyError:
  _ensure_exists(name, path=path)
  log.debug('Checking if LXC container {0} is attachable'.format(name))
  cmd = 'lxc-attach'
  if path:
   cmd += ' -P {0}'.format(pipes.quote(path))
  cmd += ' --clear-env -n {0} -- /usr/bin/env'.format(name)
  result = (__salt__['cmd.retcode'](cmd, python_shell=False, output_loglevel='quiet', ignore_retcode=True) == 0)
  __context__[cachekey] = result
 return __context__[cachekey]

def attachable ( name , path = None ) : cachekey = 'lxc.attachable{0}{1}' . format ( name , path ) try : return __context__ [ cachekey ] except KeyError : _ensure_exists ( name , path = path ) log . debug ( 'Checking if LXC container {0} is attachable' . format ( name ) ) cmd = 'lxc-attach' if path : cmd += ' -P {0}' . format ( pipes . quote ( path ) ) cmd += ' --clear-env -n {0} -- /usr/bin/env' . format ( name ) result = ( __salt__ [ 'cmd.retcode' ] ( cmd , python_shell = False , output_loglevel = 'quiet' , ignore_retcode = True ) == 0 ) __context__ [ cachekey ] = result return __context__ [ cachekey ]
return true if the named container can be attached to via the lxc-attach command path path to the container parent default: /var/lib/lxc .