

def end(self, job_id, result):
    "\n        Apply the 'end' action to the session object\n        If the request can be accepted it modifies the relevant fields\n        and sets the need_update member to notify that the stored\n        document needs to be updated\n        "
    now = int(time.time())
    now.set_job_end(job_id, result, now)
    new_result = self.get_job_overall_result()
    if (self.doc.get('status', '') != 'completed'):
        if (new_result in ['fail', 'success']):
            self.doc['time_end'] = now
            self.doc['result'] = new_result
            self.doc['status'] = 'completed'
    self.action_result = 'success'
    self.need_update = True

dataset/ETHPy150Open openstack/freezer-api/freezer_api/api/v1/sessions.py Session.end/VarMisuse@27/114 `self`->`now`