Removed #rabbit_server method
				
					
				
			This was a mistake on my part adding this method. The rabbit-host directive takes a host, not a host and port. We are going to lock 0.3.0 version of this library Monday, and not add any minor features. Wanted to delete this confusing method, before we lock this version down. Change-Id: Ibc48fc267f2b0a1ee83963f49818edbd67adaca2
This commit is contained in:
		@@ -5,8 +5,6 @@ This file is used to list changes made in each version of cookbook-openstack-com
 | 
			
		||||
## 0.3.0:
 | 
			
		||||
* Added `#rabbit_servers` method, which returns a comma-delimited string of rabbit
 | 
			
		||||
  servers in the format of host:port.
 | 
			
		||||
* Added `#rabbit_server` method, which returns a single rabbit server in the format
 | 
			
		||||
  of host:port.
 | 
			
		||||
* The `#memcached_servers` method no longer accepts an environment.
 | 
			
		||||
* Re-factored methods which search to a generic `#search_for`.
 | 
			
		||||
* Added `#address_for` method, which returns the IPv4 (default) address of the given
 | 
			
		||||
 
 | 
			
		||||
@@ -73,21 +73,4 @@ module ::Openstack
 | 
			
		||||
      end.sort.join ","
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # Returns a single rabbit server.
 | 
			
		||||
  # Uses the value for ["openstack"]["mq"]["host"] when set, otherwise
 | 
			
		||||
  # will perform a search.
 | 
			
		||||
  #
 | 
			
		||||
  # @return [String] Rabbit server in the format of '<ip>:<port>'.
 | 
			
		||||
  def rabbit_server
 | 
			
		||||
    if node["openstack"]["mq"]["host"]
 | 
			
		||||
      host = node["openstack"]["mq"]["host"]
 | 
			
		||||
      port = node["openstack"]["mq"]["port"]
 | 
			
		||||
 | 
			
		||||
      "#{host}:#{port}"
 | 
			
		||||
    else
 | 
			
		||||
      node.override["openstack"]["mq"]["servers"] = nil # safe
 | 
			
		||||
      rabbit_servers.split(",")[0]
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -127,33 +127,4 @@ describe ::Openstack do
 | 
			
		||||
      expect(resp).to eq "1.1.1.1:5672,2.2.2.2:5672"
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  describe "#rabbit_server" do
 | 
			
		||||
    it "returns a rabbit server" do
 | 
			
		||||
      @subject.stub(:node).and_return @chef_run.node
 | 
			
		||||
      @subject.stub(:rabbit_servers).
 | 
			
		||||
        and_return "1.1.1.1:5672"
 | 
			
		||||
      resp = @subject.rabbit_server
 | 
			
		||||
 | 
			
		||||
      expect(resp).to eq "1.1.1.1:5672"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "returns a rabbit server when multiple servers returned" do
 | 
			
		||||
      @subject.stub(:node).and_return @chef_run.node
 | 
			
		||||
      @subject.stub(:rabbit_servers).
 | 
			
		||||
        and_return "1.1.1.1:5672,2.2.2.2:5672"
 | 
			
		||||
      resp = @subject.rabbit_server
 | 
			
		||||
 | 
			
		||||
      expect(resp).to eq "1.1.1.1:5672"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "returns a rabbit server when not searching" do
 | 
			
		||||
      node = @chef_run.node
 | 
			
		||||
      node.set["openstack"]["mq"]["host"] = "1.1.1.1"
 | 
			
		||||
      @subject.stub(:node).and_return @chef_run.node
 | 
			
		||||
      resp = @subject.rabbit_server
 | 
			
		||||
 | 
			
		||||
      expect(resp).to eq "1.1.1.1:5672"
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user