Commit ee180910 authored by Neil Williams's avatar Neil Williams Committed by Remi Duraffort
Browse files

Ignore retired devices in validate call

Change-Id: I5e15bef09ce4292dfac44a2b37ed2eaaabeee9db
parent 8023ef05
......@@ -930,6 +930,7 @@ class SchedulerAPI(ExposedAPI):
Validate that the device dictionary and device-type template
together create a valid YAML file which matches the pipeline
device schema.
Retired devices are ignored.
See also get_pipeline_device_config
......@@ -952,9 +953,11 @@ class SchedulerAPI(ExposedAPI):
"""
if not hostname:
devices = Device.objects.filter(is_pipeline=True)
devices = Device.objects.filter(
Q(is_pipeline=True) & ~Q(status=Device.RETIRED))
else:
devices = Device.objects.filter(is_pipeline=True, hostname=hostname)
devices = Device.objects.filter(
Q(is_pipeline=True) & ~Q(status=Device.RETIRED & Q(hostname=hostname)))
if not devices and hostname:
raise xmlrpclib.Fault(
404, "No pipeline device found with hostname %s" % hostname
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment