@_ensure_exists
def state(name):
    '''
    Return state of container (running or stopped)

    CLI Example:

    .. code-block:: bash

        salt myminion nspawn.state <name>
    '''
    try:
        cmd = 'show {0} --property=State'.format(name)
        return _machinectl(cmd, ignore_retcode=True)['stdout'].split('=')[-1]
    except __HOLE__:
        return 'stopped'
dataset/ETHPy150Open saltstack/salt/salt/modules/nspawn.py/state