summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAJ Christensen <aj@junglist.gen.nz>2009-09-09 02:06:26 +1200
committerAJ Christensen <aj@junglist.gen.nz>2009-09-09 02:06:26 +1200
commit31456f5b12e540d504c981fc9cbe34bd9cb0788a (patch)
treef229ed788fa53b628eadcce776cc774ed8052561
parentfadea36b29e59d04ad58884982f3caee0154b8c7 (diff)
downloadchef-31456f5b12e540d504c981fc9cbe34bd9cb0788a.tar.gz
CHEF-546: Slight refactor of couchdb version comp
Jan recommended that we only have a specific case for 0.8, as everything higher than that uses the new standardised format. Also, we're not using SHOW or LIST API's from CouchDB so no need to worry about 0.10 or 0.11 breakages.
-rw-r--r--chef/lib/chef/couchdb.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/chef/lib/chef/couchdb.rb b/chef/lib/chef/couchdb.rb
index 2ec2175c26..caae577280 100644
--- a/chef/lib/chef/couchdb.rb
+++ b/chef/lib/chef/couchdb.rb
@@ -153,12 +153,16 @@ class Chef
end
def view_uri(design, view)
- Chef::Config[:couchdb_version] ||= @rest.run_request(:GET, URI.parse(@rest.url + "/"), false, 10, false)["version"].gsub(/-.+/,"").to_f
+ Chef::Config[:couchdb_version] ||= @rest.run_request(:GET,
+ URI.parse(@rest.url + "/"),
+ false,
+ 10,
+ false)["version"].gsub(/-.+/,"").to_f
case Chef::Config[:couchdb_version]
- when 0.9, 0.10
- "#{Chef::Config[:couchdb_database]}/_design/#{design}/_view/#{view}"
when 0.8
"#{Chef::Config[:couchdb_database]}/_view/#{design}/#{view}"
+ else
+ "#{Chef::Config[:couchdb_database]}/_design/#{design}/_view/#{view}"
end
end