[ARVADOS] updated: 26f139f761174328ea43114a3ef9cb9ad873149a

git at public.curoverse.com git at public.curoverse.com
Thu Sep 18 13:29:28 EDT 2014


Summary of changes:
 services/api/app/models/node.rb     | 2 +-
 services/api/test/unit/node_test.rb | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

       via  26f139f761174328ea43114a3ef9cb9ad873149a (commit)
      from  4cf16efd4dc5097b59e900d84eef3bf98d80b16f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 26f139f761174328ea43114a3ef9cb9ad873149a
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Sep 18 13:29:23 2014 -0400

    3605: Do .to_i on total_cpu_cores, total_ram_mb, and total_scratch_mb in Node#ping.

diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index 5311146..45fd3b1 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -115,7 +115,7 @@ class Node < ArvadosModel
     # Record other basic stats
     ['total_cpu_cores', 'total_ram_mb', 'total_scratch_mb'].each do |key|
       if value = (o[key] or o[key.to_sym])
-        self.properties[key] = value
+        self.properties[key] = value.to_i
       else
         self.properties.delete(key)
       end
diff --git a/services/api/test/unit/node_test.rb b/services/api/test/unit/node_test.rb
index 1c5a8e6..8e1233c 100644
--- a/services/api/test/unit/node_test.rb
+++ b/services/api/test/unit/node_test.rb
@@ -11,13 +11,13 @@ class NodeTest < ActiveSupport::TestCase
 
   test "pinging a node can add and update stats" do
     node = ping_node(:idle, {total_cpu_cores: '12', total_ram_mb: '512'})
-    assert_equal(12, node.properties['total_cpu_cores'].to_i)
-    assert_equal(512, node.properties['total_ram_mb'].to_i)
+    assert_equal(12, node.properties['total_cpu_cores'])
+    assert_equal(512, node.properties['total_ram_mb'])
   end
 
   test "stats disappear if not in a ping" do
     node = ping_node(:idle, {total_ram_mb: '256'})
     refute_includes(node.properties, 'total_cpu_cores')
-    assert_equal(256, node.properties['total_ram_mb'].to_i)
+    assert_equal(256, node.properties['total_ram_mb'])
   end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list