def get_state_name_by_id(self, id): if self.states is None: self.states = Rest.list_job_state() for state in self.states: if state['id'] == id: return state['name']
def get_state_id_by_name(self, name): if self.states is None: self.states = Rest.list_job_state() for state in self.states: if state['name'] == name: return state['id']