X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9b0654adfffaac018395de29f6e441b843d46e85..ba917d72d48615cdd0c6da87d41b6bd0f9f26666:/apps/workbench/app/models/container_work_unit.rb diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb index ed82f18036..84fc1f8f09 100644 --- a/apps/workbench/app/models/container_work_unit.rb +++ b/apps/workbench/app/models/container_work_unit.rb @@ -53,6 +53,10 @@ class ContainerWorkUnit < ProxyWorkUnit get(:container_uuid) end + def requesting_container_uuid + get(:requesting_container_uuid) + end + def priority @proxied.priority end @@ -81,8 +85,11 @@ class ContainerWorkUnit < ProxyWorkUnit def state_label ec = exit_code return "Failed" if (ec && ec != 0) + state = get_combined(:state) - return "Ready" if ((priority == 0) and (["Queued", "Locked"].include?(state))) + + return "Queued" if state == "Locked" + return "Cancelled" if ((priority == 0) and (state == "Queued")) state end @@ -163,6 +170,13 @@ class ContainerWorkUnit < ProxyWorkUnit protected def get_combined key - get(key, @container) || get(key, @proxied) + from_container = get(key, @container) + from_proxied = get(key, @proxied) + + if from_container.is_a? Hash or from_container.is_a? Array + if from_container.any? then from_container else from_proxied end + else + from_container || from_proxied + end end end