X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d8a9500ef903c96ea46bf2a2932fc30389ad46dc..32ea7036d2cb438f5c313cff73cfe17610a3b8b9:/services/api/app/models/container.rb diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb index 6ef9d7cbd3..bd586907ee 100644 --- a/services/api/app/models/container.rb +++ b/services/api/app/models/container.rb @@ -224,26 +224,10 @@ class Container < ArvadosModel next end - pdh = mount['portable_data_hash'] - uuid = mount['uuid'] + uuid = mount.delete 'uuid' - # Prioritize PDH over UUID for mount selection - if not pdh.nil? - c = Collection. - readable_by(current_user). - where(portable_data_hash: pdh) - if c.count > 0 - if uuid && c.where(uuid: uuid).count == 0 - raise ArgumentError.new "cannot mount collection #{uuid.inspect}: current portable_data_hash #{pdh.inspect} does not match #{c.first.portable_data_hash.inspect} in request" - end - # mount.delete 'uuid' - next - end - raise ArgumentError.new "cannot mount collection #{pdh.inspect}: not found" - end - - # PDH not supplied, try by UUID - if uuid + if mount['portable_data_hash'].nil? and !uuid.nil? + # PDH not supplied, try by UUID c = Collection. readable_by(current_user). where(uuid: uuid). @@ -295,14 +279,6 @@ class Container < ArvadosModel candidates = candidates.where_serialized(:runtime_constraints, resolve_runtime_constraints(attrs[:runtime_constraints]), md5: true) log_reuse_info(candidates) { "after filtering on runtime_constraints #{attrs[:runtime_constraints].inspect}" } - candidates = candidates.where('runtime_user_uuid = ? or (runtime_user_uuid is NULL and runtime_auth_scopes is NULL)', - attrs[:runtime_user_uuid]) - log_reuse_info(candidates) { "after filtering on runtime_user_uuid #{attrs[:runtime_user_uuid].inspect}" } - - candidates = candidates.where('runtime_auth_scopes = ? or (runtime_user_uuid is NULL and runtime_auth_scopes is NULL)', - SafeJSON.dump(attrs[:runtime_auth_scopes].sort)) - log_reuse_info(candidates) { "after filtering on runtime_auth_scopes #{attrs[:runtime_auth_scopes].inspect}" } - log_reuse_info { "checking for state=Complete with readable output and log..." } select_readable_pdh = Collection.