[ARVADOS] created: 1.1.3-75-g64213b1
Git user
git at public.curoverse.com
Fri Feb 16 14:04:21 EST 2018
at 64213b141eb2399593d9c3a814e820e997454d89 (commit)
commit 64213b141eb2399593d9c3a814e820e997454d89
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Fri Feb 16 13:55:24 2018 -0500
13098: 12199: Fix hostname assigned but not saved.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/services/api/app/controllers/arvados/v1/nodes_controller.rb b/services/api/app/controllers/arvados/v1/nodes_controller.rb
index 247d15e..eb14079 100644
--- a/services/api/app/controllers/arvados/v1/nodes_controller.rb
+++ b/services/api/app/controllers/arvados/v1/nodes_controller.rb
@@ -37,8 +37,9 @@ class Arvados::V1::NodesController < ApplicationController
attrs_to_update = resource_attrs.reject { |k,v|
[:kind, :etag, :href].index k
}
- @object.update_attributes!(attrs_to_update)
+ @object.update_attributes(attrs_to_update)
@object.assign_slot if params[:assign_slot]
+ @object.save!
show
end
diff --git a/services/api/test/functional/arvados/v1/nodes_controller_test.rb b/services/api/test/functional/arvados/v1/nodes_controller_test.rb
index c198c4c..dc8b3ac 100644
--- a/services/api/test/functional/arvados/v1/nodes_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/nodes_controller_test.rb
@@ -92,6 +92,10 @@ class Arvados::V1::NodesControllerTest < ActionController::TestCase
assert_operator 0, :<, json_response['slot_number']
n = json_response['slot_number']
assert_equal "compute#{n}", json_response['hostname']
+
+ node = Node.where(uuid: json_response['uuid']).first
+ assert_equal n, node.slot_number
+ assert_equal "compute#{n}", node.hostname
end
test "update node and assign slot" do
@@ -102,6 +106,10 @@ class Arvados::V1::NodesControllerTest < ActionController::TestCase
assert_operator 0, :<, json_response['slot_number']
n = json_response['slot_number']
assert_equal "compute#{n}", json_response['hostname']
+
+ node.reload
+ assert_equal n, node.slot_number
+ assert_equal "compute#{n}", node.hostname
end
test "update node and assign slot, don't clobber hostname" do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list