'Display the given job\'s running state.'

def state(self, name):

    systemdActiveStateMap = {'active': 'up', 'reloading': 'down', 'inactive': 'created', 'failed': 'crashed', 'activating': 'down', 'deactivating': 'down'}
    try:
        self._get_unit(name)
        state = self._wait_for_container_state(name)
        activeState = state['systemdActiveState']
        if ((activeState == 'failed') and (state['systemdLoadState'] == 'loaded')):
            return JobState.created
        return getattr(JobState, systemdActiveStateMap[activeState])
    except KeyError:
        return JobState.error
    except RuntimeError:
        return JobState.destroyed
