projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15656: Fix missing permission check.
[arvados.git]
/
services
/
api
/
app
/
models
/
keep_disk.rb
diff --git
a/services/api/app/models/keep_disk.rb
b/services/api/app/models/keep_disk.rb
index 612696b89b5d611bb9a157ee00b6c3608bc10973..5751c135d8f9cdd57cc3f2f3ed5d77723c7abe6c 100644
(file)
--- a/
services/api/app/models/keep_disk.rb
+++ b/
services/api/app/models/keep_disk.rb
@@
-1,3
+1,7
@@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
class KeepDisk < ArvadosModel
include HasUuid
include KindAndEtag
class KeepDisk < ArvadosModel
include HasUuid
include KindAndEtag
@@
-37,35
+41,26
@@
class KeepDisk < ArvadosModel
@bypass_arvados_authorization = true
self.update_attributes!(o.select { |k,v|
@bypass_arvados_authorization = true
self.update_attributes!(o.select { |k,v|
- [:service_host,
- :service_port,
- :service_ssl_flag,
- :bytes_total,
+ [:bytes_total,
:bytes_free,
:is_readable,
:is_writable,
:last_read_at,
:last_write_at
].collect(&:to_s).index k
:bytes_free,
:is_readable,
:is_writable,
:last_read_at,
:last_write_at
].collect(&:to_s).index k
- }.merge(last_ping_at:
Time.now
))
+ }.merge(last_ping_at:
db_current_time
))
end
def service_host
end
def service_host
- KeepService.where(uuid: self.keep_service_uuid) do |k|
- return k.service_host
- end
+ KeepService.find_by_uuid(self.keep_service_uuid).andand.service_host
end
def service_port
end
def service_port
- KeepService.where(uuid: self.keep_service_uuid) do |k|
- return k.service_port
- end
+ KeepService.find_by_uuid(self.keep_service_uuid).andand.service_port
end
def service_ssl_flag
end
def service_ssl_flag
- KeepService.where(uuid: self.keep_service_uuid) do |k|
- return k.service_ssl_flag
- end
+ KeepService.find_by_uuid(self.keep_service_uuid).andand.service_ssl_flag
end
protected
end
protected