def SetPid(self, pid):
    status = self.CalcStatus()

    if status in (constants.JOB_STATUS_QUEUED,
                  constants.JOB_STATUS_WAITING):
      if self.process_id is not None:
        logging.warning("Replacing the process id %s of job %s with %s",
                        self.process_id, self.id, pid)
      self.process_id = pid
    else:
      logging.warning("Can set pid only for queued/waiting jobs")
Deallocate port for instance.
dataset/ETHPy150Open ganeti/ganeti/lib/jqueue/__init__.py/_QueuedJob.SetPid--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/network/base_api.py/NetworkAPI.deallocate_port_for_instance