chef-server-api 0.10.10.beta.1 → 0.10.10.rc.1
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/README.rdoc +13 -13
- data/config/router.rb +4 -4
- data/lib/chef-server-api/version.rb +1 -1
- data/spec/unit/cookbooks_controller_spec.rb +10 -8
- metadata +79 -26
data/README.rdoc
CHANGED
@@ -12,19 +12,19 @@ I'm in ur netwerk, cookin up yer servers. :)
|
|
12
12
|
|
13
13
|
chef:
|
14
14
|
|
15
|
-
* ruby-openid
|
16
|
-
* json
|
17
|
-
* erubis
|
18
|
-
* stomp
|
19
|
-
* ohai
|
15
|
+
* ruby-openid
|
16
|
+
* json
|
17
|
+
* erubis
|
18
|
+
* stomp
|
19
|
+
* ohai
|
20
20
|
|
21
21
|
chef-server and the chef-server-api (merb slice), same requires as chef above, plus:
|
22
22
|
|
23
|
-
* merb-core
|
24
|
-
* merb-haml
|
23
|
+
* merb-core
|
24
|
+
* merb-haml
|
25
25
|
* thin
|
26
26
|
* haml
|
27
|
-
* ruby-openid
|
27
|
+
* ruby-openid
|
28
28
|
* syntax
|
29
29
|
|
30
30
|
Interim Note:
|
@@ -46,10 +46,10 @@ External Servers:
|
|
46
46
|
Install all of the above. To fire up a develpment environment, do the following:
|
47
47
|
|
48
48
|
* Start CouchDB with 'couchdb'
|
49
|
-
* Start stompserver with 'stompserver'
|
49
|
+
* Start stompserver with 'stompserver'
|
50
50
|
* Start chef-indexer with:
|
51
51
|
|
52
|
-
chef-indexer -l debug
|
52
|
+
chef-indexer -l debug
|
53
53
|
|
54
54
|
* Start chef-server:
|
55
55
|
|
@@ -57,7 +57,7 @@ Install all of the above. To fire up a develpment environment, do the following
|
|
57
57
|
|
58
58
|
* Test run chef to begin node registration:
|
59
59
|
|
60
|
-
sudo ./bin/chef-client
|
60
|
+
sudo ./bin/chef-client
|
61
61
|
|
62
62
|
* Validate the node registration:
|
63
63
|
|
@@ -67,14 +67,14 @@ Install all of the above. To fire up a develpment environment, do the following
|
|
67
67
|
|
68
68
|
* Test run chef with:
|
69
69
|
|
70
|
-
chef-client
|
70
|
+
chef-client
|
71
71
|
|
72
72
|
== LICENSE:
|
73
73
|
|
74
74
|
Chef - A configuration management system
|
75
75
|
|
76
76
|
Author:: Adam Jacob (<adam@opscode.com>)
|
77
|
-
Copyright:: Copyright (c) 2008 Opscode, Inc.
|
77
|
+
Copyright:: Copyright (c) 2008-2012 Opscode, Inc.
|
78
78
|
License:: Apache License, Version 2.0
|
79
79
|
|
80
80
|
Licensed under the Apache License, Version 2.0 (the "License");
|
data/config/router.rb
CHANGED
@@ -70,19 +70,19 @@ Merb::Router.prepare do
|
|
70
70
|
match("/cookbooks/:cookbook_name/:cookbook_version",
|
71
71
|
:method => 'put',
|
72
72
|
:cookbook_name => /[\w\.]+/,
|
73
|
-
:cookbook_version =>
|
73
|
+
:cookbook_version => /^(\d+.\d+(?:.\d+)?)$/
|
74
74
|
).to(:controller => "cookbooks", :action => "update")
|
75
75
|
|
76
76
|
match("/cookbooks/:cookbook_name/:cookbook_version",
|
77
77
|
:method => 'get',
|
78
78
|
:cookbook_name => /[\w\.]+/,
|
79
|
-
:cookbook_version =>
|
79
|
+
:cookbook_version => /^((?:\d+.\d+(?:.\d+)?)|_latest)$/
|
80
80
|
).to(:controller => "cookbooks", :action => "show").name(:cookbook_version)
|
81
81
|
|
82
82
|
match("/cookbooks/:cookbook_name/:cookbook_version",
|
83
83
|
:method => 'delete',
|
84
84
|
:cookbook_name => /[\w\.]+/,
|
85
|
-
:cookbook_version =>
|
85
|
+
:cookbook_version => /^((?:\d+.\d+(?:.\d+)?)|_latest)$/
|
86
86
|
).to(:controller => "cookbooks", :action => "destroy")
|
87
87
|
|
88
88
|
match("/cookbooks/:cookbook_name",
|
@@ -92,7 +92,7 @@ Merb::Router.prepare do
|
|
92
92
|
|
93
93
|
match("/cookbooks/:cookbook_name/:cookbook_version/files/:checksum",
|
94
94
|
:cookbook_name => /[\w\.]+/,
|
95
|
-
:cookbook_version =>
|
95
|
+
:cookbook_version => /^((?:\d+.\d+(?:.\d+)?)|_latest)$/
|
96
96
|
).to(
|
97
97
|
:controller => "cookbooks",
|
98
98
|
:action => "show_file"
|
@@ -26,12 +26,13 @@ describe "Cookbooks Controller" do
|
|
26
26
|
Merb.logger.set_log(StringIO.new)
|
27
27
|
end
|
28
28
|
|
29
|
+
MAXMAJOR=25
|
29
30
|
describe "when several versions of multiple cookbooks exist" do
|
30
31
|
before do
|
31
32
|
@cookbook_a_versions = (0...7).map { |i| "1.0.#{i}"}
|
32
|
-
@cookbook_b_versions = (0...3).map { |i| "
|
33
|
+
@cookbook_b_versions = (0...3).map { |i| "#{MAXMAJOR}.0.#{i}" }
|
33
34
|
Chef::CookbookVersion.stub!(:cdb_list).and_return("cookbook-a" => @cookbook_a_versions, "cookbook-b" => @cookbook_b_versions)
|
34
|
-
Chef::CookbookVersion.stub!(:cdb_list_latest).and_return('cookbook-a' => '1.0.6', 'cookbook-b' => '
|
35
|
+
Chef::CookbookVersion.stub!(:cdb_list_latest).and_return('cookbook-a' => '1.0.6', 'cookbook-b' => '#{MAXMAJOR}.0.2')
|
35
36
|
Chef::CookbookVersion.stub!(:cdb_by_name).with('cookbook-a').and_return("cookbook-a" => @cookbook_a_versions)
|
36
37
|
end
|
37
38
|
|
@@ -52,15 +53,16 @@ describe "Cookbooks Controller" do
|
|
52
53
|
get_json('/cookbooks/cookbook-a').should == expected
|
53
54
|
end
|
54
55
|
|
56
|
+
cookbook_version = "#{MAXMAJOR}.0.3"
|
55
57
|
it "downloads a file from a cookbook" do
|
56
|
-
cookbook = make_cookbook("cookbook-a", "
|
58
|
+
cookbook = make_cookbook("cookbook-a", "#{cookbook_version}")
|
57
59
|
cookbook.checksums["1234"] = nil
|
58
60
|
stub_checksum("1234")
|
59
|
-
Chef::CookbookVersion.should_receive(:cdb_load).with("cookbook-a", "
|
61
|
+
Chef::CookbookVersion.should_receive(:cdb_load).with("cookbook-a", "#{cookbook_version}").and_return(cookbook)
|
60
62
|
expected = {}
|
61
63
|
expected_cookbook_a_data = @cookbook_a_versions.map {|v| {"url" => "#{root_url}/cookbooks/cookbook-a/#{v}", "version" => v}}.reverse
|
62
64
|
expected['cookbook-a'] = {"url" => "#{root_url}/cookbooks/cookbook-a", "versions" => expected_cookbook_a_data}
|
63
|
-
response = get("/cookbooks/cookbook-a/
|
65
|
+
response = get("/cookbooks/cookbook-a/#{cookbook_version}/files/1234") do |controller|
|
64
66
|
stub_authentication(controller)
|
65
67
|
controller.should_receive(:send_file).with("/var/chef/checksums/12/1234").and_return("file-content")
|
66
68
|
end
|
@@ -69,15 +71,15 @@ describe "Cookbooks Controller" do
|
|
69
71
|
end
|
70
72
|
|
71
73
|
it "gets an error in case of missing file on download" do
|
72
|
-
cookbook = make_cookbook("cookbook-a", "
|
74
|
+
cookbook = make_cookbook("cookbook-a", "#{cookbook_version}")
|
73
75
|
cookbook.checksums["1234"] = nil
|
74
76
|
stub_checksum("1234", false)
|
75
|
-
Chef::CookbookVersion.should_receive(:cdb_load).with("cookbook-a", "
|
77
|
+
Chef::CookbookVersion.should_receive(:cdb_load).with("cookbook-a", "#{cookbook_version}").and_return(cookbook)
|
76
78
|
expected = {}
|
77
79
|
expected_cookbook_a_data = @cookbook_a_versions.map {|v| {"url" => "#{root_url}/cookbooks/cookbook-a/#{v}", "version" => v}}.reverse
|
78
80
|
expected['cookbook-a'] = {"url" => "#{root_url}/cookbooks/cookbook-a", "versions" => expected_cookbook_a_data}
|
79
81
|
lambda do
|
80
|
-
response = get("/cookbooks/cookbook-a/
|
82
|
+
response = get("/cookbooks/cookbook-a/#{cookbook_version}/files/1234") do |controller|
|
81
83
|
stub_authentication(controller)
|
82
84
|
end
|
83
85
|
end.should raise_error(Merb::ControllerExceptions::InternalServerError, /File with checksum 1234 not found in the repository/)
|
metadata
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-server-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15424231
|
4
5
|
prerelease: 8
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 10
|
9
|
+
- 10
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 0.10.10.rc.1
|
6
13
|
platform: ruby
|
7
14
|
authors:
|
8
15
|
- Opscode
|
@@ -10,96 +17,134 @@ autorequire:
|
|
10
17
|
bindir: bin
|
11
18
|
cert_chain: []
|
12
19
|
|
13
|
-
date: 2012-04-
|
20
|
+
date: 2012-04-30 00:00:00 Z
|
14
21
|
dependencies:
|
15
22
|
- !ruby/object:Gem::Dependency
|
16
|
-
name: merb-core
|
17
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
18
24
|
none: false
|
19
25
|
requirements:
|
20
26
|
- - ~>
|
21
27
|
- !ruby/object:Gem::Version
|
28
|
+
hash: 19
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 1
|
32
|
+
- 0
|
22
33
|
version: 1.1.0
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
34
|
version_requirements: *id001
|
35
|
+
name: merb-core
|
36
|
+
prerelease: false
|
37
|
+
type: :runtime
|
26
38
|
- !ruby/object:Gem::Dependency
|
27
|
-
name: merb-assets
|
28
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
29
40
|
none: false
|
30
41
|
requirements:
|
31
42
|
- - ~>
|
32
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 19
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 1
|
48
|
+
- 0
|
33
49
|
version: 1.1.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
50
|
version_requirements: *id002
|
51
|
+
name: merb-assets
|
52
|
+
prerelease: false
|
53
|
+
type: :runtime
|
37
54
|
- !ruby/object:Gem::Dependency
|
38
|
-
name: merb-helpers
|
39
55
|
requirement: &id003 !ruby/object:Gem::Requirement
|
40
56
|
none: false
|
41
57
|
requirements:
|
42
58
|
- - ~>
|
43
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 19
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 1
|
64
|
+
- 0
|
44
65
|
version: 1.1.0
|
45
|
-
type: :runtime
|
46
|
-
prerelease: false
|
47
66
|
version_requirements: *id003
|
67
|
+
name: merb-helpers
|
68
|
+
prerelease: false
|
69
|
+
type: :runtime
|
48
70
|
- !ruby/object:Gem::Dependency
|
49
|
-
name: merb-param-protection
|
50
71
|
requirement: &id004 !ruby/object:Gem::Requirement
|
51
72
|
none: false
|
52
73
|
requirements:
|
53
74
|
- - ~>
|
54
75
|
- !ruby/object:Gem::Version
|
76
|
+
hash: 19
|
77
|
+
segments:
|
78
|
+
- 1
|
79
|
+
- 1
|
80
|
+
- 0
|
55
81
|
version: 1.1.0
|
56
|
-
type: :runtime
|
57
|
-
prerelease: false
|
58
82
|
version_requirements: *id004
|
83
|
+
name: merb-param-protection
|
84
|
+
prerelease: false
|
85
|
+
type: :runtime
|
59
86
|
- !ruby/object:Gem::Dependency
|
60
|
-
name: mixlib-authentication
|
61
87
|
requirement: &id005 !ruby/object:Gem::Requirement
|
62
88
|
none: false
|
63
89
|
requirements:
|
64
90
|
- - ">="
|
65
91
|
- !ruby/object:Gem::Version
|
92
|
+
hash: 21
|
93
|
+
segments:
|
94
|
+
- 1
|
95
|
+
- 1
|
96
|
+
- 3
|
66
97
|
version: 1.1.3
|
67
|
-
type: :runtime
|
68
|
-
prerelease: false
|
69
98
|
version_requirements: *id005
|
99
|
+
name: mixlib-authentication
|
100
|
+
prerelease: false
|
101
|
+
type: :runtime
|
70
102
|
- !ruby/object:Gem::Dependency
|
71
|
-
name: dep_selector
|
72
103
|
requirement: &id006 !ruby/object:Gem::Requirement
|
73
104
|
none: false
|
74
105
|
requirements:
|
75
106
|
- - ">="
|
76
107
|
- !ruby/object:Gem::Version
|
108
|
+
hash: 25
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
- 0
|
112
|
+
- 3
|
77
113
|
version: 0.0.3
|
78
|
-
type: :runtime
|
79
|
-
prerelease: false
|
80
114
|
version_requirements: *id006
|
115
|
+
name: dep_selector
|
116
|
+
prerelease: false
|
117
|
+
type: :runtime
|
81
118
|
- !ruby/object:Gem::Dependency
|
82
|
-
name: uuidtools
|
83
119
|
requirement: &id007 !ruby/object:Gem::Requirement
|
84
120
|
none: false
|
85
121
|
requirements:
|
86
122
|
- - ~>
|
87
123
|
- !ruby/object:Gem::Version
|
124
|
+
hash: 9
|
125
|
+
segments:
|
126
|
+
- 2
|
127
|
+
- 1
|
128
|
+
- 1
|
88
129
|
version: 2.1.1
|
89
|
-
type: :runtime
|
90
|
-
prerelease: false
|
91
130
|
version_requirements: *id007
|
131
|
+
name: uuidtools
|
132
|
+
prerelease: false
|
133
|
+
type: :runtime
|
92
134
|
- !ruby/object:Gem::Dependency
|
93
|
-
name: thin
|
94
135
|
requirement: &id008 !ruby/object:Gem::Requirement
|
95
136
|
none: false
|
96
137
|
requirements:
|
97
138
|
- - ">="
|
98
139
|
- !ruby/object:Gem::Version
|
140
|
+
hash: 3
|
141
|
+
segments:
|
142
|
+
- 0
|
99
143
|
version: "0"
|
100
|
-
type: :runtime
|
101
|
-
prerelease: false
|
102
144
|
version_requirements: *id008
|
145
|
+
name: thin
|
146
|
+
prerelease: false
|
147
|
+
type: :runtime
|
103
148
|
description: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.
|
104
149
|
email: chef@opscode.com
|
105
150
|
executables:
|
@@ -181,12 +226,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
226
|
requirements:
|
182
227
|
- - ">="
|
183
228
|
- !ruby/object:Gem::Version
|
229
|
+
hash: 3
|
230
|
+
segments:
|
231
|
+
- 0
|
184
232
|
version: "0"
|
185
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
234
|
none: false
|
187
235
|
requirements:
|
188
236
|
- - ">"
|
189
237
|
- !ruby/object:Gem::Version
|
238
|
+
hash: 25
|
239
|
+
segments:
|
240
|
+
- 1
|
241
|
+
- 3
|
242
|
+
- 1
|
190
243
|
version: 1.3.1
|
191
244
|
requirements: []
|
192
245
|
|