code: def stop(name, kill=False):
      '''
      This is a compatibility function which provides the logic for
      nspawn.poweroff and nspawn.terminate.
      '''
      if _sd_version() >= 219:
          if kill:
              action = 'terminate'
          else:
              action = 'poweroff'
          ret = _machinectl('{0} {1}'.format(action, name))
      else:
          cmd = 'systemctl stop systemd-nspawn@{0}'.format(name)
          ret = __salt__['cmd.run_all'](cmd, python_shell=False)
  
      if ret['retcode'] != 0:
          __context__['retcode'] = salt.defaults.exitcodes.EX_UNAVAILABLE
          return False
      return Truf stop(name, kill=False):
      '''
      This is a compatibility function which provides the logic for
      nspawn.poweroff and nspawn.terminate.
      '''
      if _sd_version() >= 219:
          if kill:
              action = 'terminate'
          else:
              action = 'poweroff'
          ret = _machinectl('{0} {1}'.format(action, name))
      else:
          cmd = 'systemctl stop systemd-nspawn@{0}'.format(name)
          ret = __salt__['cmd.run_all'](cmd, python_shell=False)
  
      if ret['retcode'] != 0:
          __context__['retcode'] = salt.defaults.exitcodes.EX_UNAVAILABLE
          return False
      return True
docs: This is a compatibility function which provides the logic for
      nspawn.poweroff and nspawn.terminate.