Commit bb3ca452 authored by Rémi Duraffort's avatar Rémi Duraffort
Browse files

XMLRPC API: fix crash in scheduler.aliases

Fix a crash when the device-type alias is None. Every aliases after the
migration will be in that state.
Signed-off-by: default avatarRémi Duraffort <>
parent 85fc254b
......@@ -36,8 +36,8 @@ class SchedulerAliasesAPI(ExposedV2API):
[superuser only]
Create a device-type alias
Permission: lava_scheduler_app.add_alias
......@@ -77,8 +77,8 @@ class SchedulerAliasesAPI(ExposedV2API):
[superuser only]
Remove a device-type alias
Permission: lava_scheduler_app.delete_alias
......@@ -141,9 +141,8 @@ class SchedulerAliasesAPI(ExposedV2API):
except Alias.DoesNotExist:
raise xmlrpc.client.Fault(404, "Alias '%s' was not found." % name)
if alias.device_type.owners_only and alias.device_type.some_devices_visible_to(
dt = alias.device_type
if dt is None or (dt.owners_only and dt.some_devices_visible_to(self.user)):
return {"name":, "device_type": ""}
return {"name":, "device_type":}
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