def state(self, name):
        systemdActiveStateMap = {
            'active': 'up',
            'reloading': 'down',
            'inactive': 'created',
            'failed': 'crashed',
            'activating': 'down',
            'deactivating': 'down',
        }
        try:
            # NOTE (bacongobbler): this call to ._get_unit() acts as a pre-emptive check to
            # determine if the job no longer exists (will raise a RuntimeError on 404)
            self._get_unit(name)
            state = self._wait_for_container_state(name)
            activeState = state['systemdActiveState']
            # FIXME (bacongobbler): when fleet loads a job, sometimes it'll automatically start and
            # stop the container, which in our case will return as 'failed', even though
            # the container is perfectly fine.
            if activeState == 'failed' and state['systemdLoadState'] == 'loaded':
                return JobState.created
            return getattr(JobState, systemdActiveStateMap[activeState])
        except KeyError:
            # failed retrieving a proper response from the fleet API
            return JobState.error
        except RuntimeError:
            # failed to retrieve a response from the fleet API,
            # which means it does not exist
            return JobState.destroyed
Display the given job's running state.
dataset/ETHPy150Open deis/deis/controller/scheduler/fleet.py/FleetHTTPClient.state