When a host on a booking with multiple collaborators
has its image reset/changed, a 500 error is no longer
returned
Change-Id: Icafdf53059f35c838e0de675da6a8b8bffffe58a
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
net_relation.status = JobStatus.NEW
# re-apply ssh access after host is reset
- ssh_relation = AccessRelation.objects.get(job=job, config__access_type="ssh")
- ssh_relation.status = JobStatus.NEW
+ for relation in AccessRelation.objects.filter(job=job, config__access_type="ssh"):
+ relation.status = JobStatus.NEW
+ relation.save()
- # save them all at once to reduce the chance
- # of a lab polling and only seeing partial change
hardware_relation.save()
net_relation.save()
- ssh_relation.save()
@classmethod
def makeSnapshotTask(cls, image, booking, host):