chef-server-api 0.9.0.b01 → 0.9.0.b02

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 our API, but in a useful way...
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 #FIXME: is this cool to do w/ access control on platform?
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
- begin
150
- Chef::CookbookVersion.cdb_load(name, version)
151
- rescue Chef::Exceptions::CouchDBNotFound => e
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
 
@@ -1,3 +1,3 @@
1
1
  module ChefServerApi
2
- VERSION = '0.9.0.b01'
2
+ VERSION = '0.9.0.b02'
3
3
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 0
9
- - b01
10
- version: 0.9.0.b01
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-11 00:00:00 -07:00
18
+ date: 2010-06-13 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency