Skip to content
Browse files

make varz return node's correct plan instead of the plan in sqlite db

Change-Id: Ic737288bc74df0eccf0c2af3cb52a40dcb54ac93
  • Loading branch information...
1 parent e9e0965 commit bd9e67969e5e3f1357bbb5752047ba035fa659a7 @SlimYang SlimYang committed
View
1 memcached/config/memcached_node.yml
@@ -1,4 +1,5 @@
---
+plan: free
local_db: sqlite3:/var/vcap/services/memcached/memcached_node.db
mbus: nats://localhost:4222/
index: 0
View
2 memcached/lib/memcached_service/memcached_node.rb
@@ -391,7 +391,7 @@ def get_varz(instance)
varz = {}
varz[:name] = instance.name
varz[:port] = instance.port
- varz[:plan] = instance.plan
+ varz[:plan] = @plan
varz[:usage] = {}
varz[:usage][:capacity_unit] = capacity_unit
varz[:usage][:max_clients] = @max_clients
View
2 memcached/spec/node_spec.rb
@@ -310,7 +310,7 @@ class Node
varz[:max_instances_num].should == @options[:capacity] / @capacity_unit
varz[:provisioned_instances][0][:name].should == @credentials["name"]
varz[:provisioned_instances][0][:port].should == @credentials["port"]
- varz[:provisioned_instances][0][:plan].should == :free
+ varz[:provisioned_instances][0][:plan].should == "free"
@node.unprovision(@credentials["name"])
end
end
View
1 memcached/spec/spec_helper.rb
@@ -68,7 +68,6 @@ def get_node_config()
:memcached_log_dir => "/tmp/memcached/memcached_log",
:max_clients => parse_property(config, "max_clients", Integer),
:memcached_memory => parse_property(config, "memcached_memory", Integer),
- :plan => parse_property(config, "memcached_memory", Integer),
:local_db => 'sqlite3:/tmp/memcached/memcached_node.db',
:local_db_file => "/tmp/memcached/memcached_node.db"
}
View
2 ng/memcached/lib/memcached_service/memcached_node.rb
@@ -227,7 +227,7 @@ def varz_details
stat = {}
stat['name'] = p_service.name
stat['version'] = p_service.version
- stat['plan'] = p_service.plan
+ stat['plan'] = @plan
stat['port'] = p_service.port
stat['info'] = p_service.get_instance_stats
View
1 ng/memcached/spec/spec_helper.rb
@@ -59,7 +59,6 @@ def get_node_config()
:service_log_dir => "/tmp/memcached/memcached_log",
:max_clients => parse_property(config, "max_clients", Integer),
:memcached_memory => parse_property(config, "memcached_memory", Integer),
- :plan => parse_property(config, "memcached_memory", Integer),
:local_db => 'sqlite3:/tmp/memcached/memcached_node.db',
:local_db_file => "/tmp/memcached/memcached_node.db",
:supported_versions => parse_property(config, "supported_versions", Array, :optional => true) || ["1.4"],
View
2 ng/redis/lib/redis_service/redis_node.rb
@@ -270,7 +270,7 @@ def get_varz(instance)
varz = {}
varz[:name] = instance.name
varz[:port] = instance.port
- varz[:plan] = instance.plan
+ varz[:plan] = @plan
varz[:version] = instance.version
varz[:usage] = {}
varz[:usage][:max_memory] = instance.memory.to_f * 1024.0
View
2 ng/redis/spec/node_spec.rb
@@ -189,7 +189,7 @@ class Node
varz[:provisioned_instances_num].should == 1
varz[:provisioned_instances][0][:name].should == @credentials["name"]
varz[:provisioned_instances][0][:port].should == @credentials["port"]
- varz[:provisioned_instances][0][:plan].should == 1
+ varz[:provisioned_instances][0][:plan].should == "free"
@node.unprovision(@credentials["name"])
end
end

0 comments on commit bd9e679

Please sign in to comment.
Something went wrong with that request. Please try again.