chef-server-api 0.9.0.b01 → 0.9.0.b02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/cookbooks.rb +9 -5
- data/lib/chef-server-api/version.rb +1 -1
- metadata +3 -3
@@ -48,7 +48,7 @@ class Cookbooks < Application
|
|
48
48
|
display response
|
49
49
|
end
|
50
50
|
|
51
|
-
#FIXME: this is different from the rest of
|
51
|
+
#FIXME: this is different from the rest of the API, but in a useful way...
|
52
52
|
def index_latest
|
53
53
|
cookbook_list = Chef::CookbookVersion.cdb_list_latest(true)
|
54
54
|
response = Hash.new
|
@@ -59,7 +59,7 @@ class Cookbooks < Application
|
|
59
59
|
display response
|
60
60
|
end
|
61
61
|
|
62
|
-
def index_recipes
|
62
|
+
def index_recipes
|
63
63
|
all_cookbooks = Array(Chef::CookbookVersion.cdb_list_latest(true))
|
64
64
|
all_cookbooks.map! do |cookbook|
|
65
65
|
cookbook.manifest["recipes"].map { |r| "#{cookbook.name}::#{r['name']}" }
|
@@ -146,10 +146,14 @@ class Cookbooks < Application
|
|
146
146
|
private
|
147
147
|
|
148
148
|
def get_cookbook_version(name, version)
|
149
|
-
|
150
|
-
|
151
|
-
|
149
|
+
Chef::CookbookVersion.cdb_load(name, version)
|
150
|
+
rescue Chef::Exceptions::CouchDBNotFound => e
|
151
|
+
raise NotFound, "Cannot find a cookbook named #{name} with version #{version}"
|
152
|
+
rescue Net::HTTPServerException => e
|
153
|
+
if e.to_s =~ /^404/
|
152
154
|
raise NotFound, "Cannot find a cookbook named #{name} with version #{version}"
|
155
|
+
else
|
156
|
+
raise
|
153
157
|
end
|
154
158
|
end
|
155
159
|
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 9
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.9.0.
|
9
|
+
- b02
|
10
|
+
version: 0.9.0.b02
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Opscode
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-13 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|