Adds an additional check to ensure that the host is
working before using it for a booking.
Change-Id: I69731ca10ad59b6b774d04bdf6f3e628e6a07a79
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
for profile in profile_count.keys():
available = Host.objects.filter(
booked=False,
+ working=True,
lab=grb.lab,
profile=profile
).count()
host_full_set = Host.objects.filter(lab__name__exact=labName, profile=genericHost.profile)
if not host_full_set.first():
raise ResourceExistenceException("No matching servers found")
- host_set = host_full_set.filter(booked=False)
+ host_set = host_full_set.filter(booked=False, working=True)
if not host_set.first():
raise ResourceAvailabilityException("No unbooked hosts match requested hosts")
host = host_set.first()