Permalink
Browse files

Modify rabbit varz details format to follow general style

Change-Id: Ia6225f2e8ec8399292acd6631ea1af6501f69d47
  • Loading branch information...
1 parent fd50300 commit ee5630ac1db5b6b96a87b00d709203a1b73690c2 Tang Rui committed Mar 6, 2012
Showing with 5 additions and 14 deletions.
  1. +4 −6 rabbit/lib/rabbit_service/rabbit_node.rb
  2. +1 −8 rabbit/spec/node_spec.rb
@@ -234,17 +234,16 @@ def varz_details
varz[:provisioned_instances] << get_varz(instance)
varz[:provisioned_instances_num] += 1
end
+ varz[:instances] = {}
+ ProvisionedService.all.each do |instance|
+ varz[:instances][instance.name.to_sym] = get_status(instance)
+ end
varz
rescue => e
@logger.warn(e)
{}
end
- def healthz_details
- # FIXME: need more code to check the node healthy
- healthz = "ok"
- end
-
def disable_instance(service_credentials, binding_credentials_list = [])
@logger.info("disable_instance request: service_credentials=#{service_credentials}, binding_credentials=#{binding_credentials_list}")
instance = get_instance(service_credentials["name"])
@@ -481,7 +480,6 @@ def get_varz(instance)
varz[:usage][:queues_num] = list_queues(credentials, instance.vhost).size
varz[:usage][:exchanges_num] = list_exchanges(credentials, instance.vhost).size
varz[:usage][:bindings_num] = list_bindings(credentials, instance.vhost).size
- varz[:status] = get_status(instance)
varz
end
@@ -261,18 +261,11 @@ class Node
varz[:provisioned_instances][0][:vhost].should == @credentials["vhost"]
varz[:provisioned_instances][0][:admin_username].should == @credentials["user"]
varz[:provisioned_instances][0][:plan].should == "free"
- varz[:provisioned_instances][0][:status].should == "ok"
+ varz[:instances][@credentials["name"].to_sym].should == "ok"
@node.unprovision(@credentials["name"])
end
end
- describe "Node.healthz_details" do
- it "should report healthz details" do
- healthz = @node.healthz_details
- healthz.should == "ok"
- end
- end
-
describe "check & purge orphan" do
it "should return proper instances & bindings list" do
before_instances = @node.all_instances_list

0 comments on commit ee5630a

Please sign in to comment.