chef 0.9.0.a10 → 0.9.0.a90

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of chef might be problematic. Click here for more details.

@@ -243,9 +243,17 @@ class Chef
243
243
  end
244
244
  end
245
245
 
246
- def load_from_file(klass, from_file)
247
- from_file = @name_args[0]
248
- relative_file = File.expand_path(File.join(Dir.pwd, 'roles', from_file))
246
+ def load_from_file(klass, from_file, bag=nil)
247
+ relative_path = ""
248
+ if klass == Chef::Role
249
+ relative_path = "roles"
250
+ elsif klass == Chef::Node
251
+ relative_path = "nodes"
252
+ elsif klass == Chef::DataBagItem
253
+ relative_path = "data_bags/#{bag}"
254
+ end
255
+
256
+ relative_file = File.expand_path(File.join(Dir.pwd, relative_path, from_file))
249
257
  filename = nil
250
258
 
251
259
  if file_exists_and_is_readable?(from_file)
@@ -42,6 +42,10 @@ class Chef
42
42
  :long => "--node-name NAME",
43
43
  :description => "The Chef node name for your new node"
44
44
 
45
+ option :prerelease,
46
+ :long => "--prerelease",
47
+ :description => "Install the pre-release chef gems"
48
+
45
49
 
46
50
  def h
47
51
  @highline ||= HighLine.new
@@ -67,7 +71,7 @@ if [ ! -f /usr/bin/chef-client ]; then
67
71
  cd rubygems-1.3.6
68
72
  ruby setup.rb
69
73
  cp /usr/bin/gem1.8 /usr/bin/gem
70
- gem install chef ohai --no-rdoc --no-ri --verbose
74
+ gem install ohai chef --no-rdoc --no-ri --verbose #{"--prerelease" if config[:prerelease]}
71
75
  fi
72
76
 
73
77
  mkdir -p /etc/chef
@@ -0,0 +1,43 @@
1
+ #
2
+ # Author:: Adam Jacob (<adam@opscode.com>)
3
+ # Copyright:: Copyright (c) 2010 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'chef/knife'
20
+ require 'chef/data_bag'
21
+ require 'chef/data_bag_item'
22
+
23
+ class Chef
24
+ class Knife
25
+ class DataBagFromFile < Knife
26
+
27
+ banner "Sub-Command: data bag from file BAG FILE (options)"
28
+
29
+ def run
30
+ updated = load_from_file(Chef::DataBagItem, @name_args[1], @name_args[0])
31
+ dbag = Chef::DataBagItem.new
32
+ dbag.data_bag(@name_args[0])
33
+ dbag.raw_data = updated
34
+ dbag.save
35
+ Chef::Log.info("Updated data_bag_item[#{@name_args[1]}]")
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+
42
+
43
+
@@ -67,13 +67,13 @@ class Chef
67
67
  # TODO: timh,cw: 2010-5-14: This means that the resources within
68
68
  # this block cannot interact with resources outside, e.g.,
69
69
  # manipulating notifies.
70
- saved_run_context = run_context
71
- self.run_context = Chef::RunContext.new(saved_run_context.node, saved_run_context.cookbook_collection)
72
-
70
+ saved_run_context = @run_context
71
+ @run_context = @run_context.dup
72
+ @run_context.resource_collection = Chef::ResourceCollection.new
73
73
  instance_eval(&block)
74
- Chef::Runner.new(run_context).converge
74
+ Chef::Runner.new(@run_context).converge
75
75
 
76
- self.run_context = saved_run_context
76
+ @run_context = saved_run_context
77
77
  end
78
78
 
79
79
  public
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  class Chef
19
- VERSION = '0.9.0.a10'
19
+ VERSION = '0.9.0.a90'
20
20
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- hash: 829723527
5
4
  prerelease: true
6
5
  segments:
7
6
  - 0
8
7
  - 9
9
8
  - 0
10
- - a10
11
- version: 0.9.0.a10
9
+ - a90
10
+ version: 0.9.0.a90
12
11
  platform: ruby
13
12
  authors:
14
13
  - Adam Jacob
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-06-07 00:00:00 -07:00
18
+ date: 2010-06-08 00:00:00 -07:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
@@ -27,7 +26,6 @@ dependencies:
27
26
  requirements:
28
27
  - - ">="
29
28
  - !ruby/object:Gem::Version
30
- hash: 19
31
29
  segments:
32
30
  - 1
33
31
  - 1
@@ -43,7 +41,6 @@ dependencies:
43
41
  requirements:
44
42
  - - ">="
45
43
  - !ruby/object:Gem::Version
46
- hash: 19
47
44
  segments:
48
45
  - 1
49
46
  - 1
@@ -59,7 +56,6 @@ dependencies:
59
56
  requirements:
60
57
  - - ">="
61
58
  - !ruby/object:Gem::Version
62
- hash: 19
63
59
  segments:
64
60
  - 1
65
61
  - 1
@@ -75,7 +71,6 @@ dependencies:
75
71
  requirements:
76
72
  - - ">="
77
73
  - !ruby/object:Gem::Version
78
- hash: 19
79
74
  segments:
80
75
  - 1
81
76
  - 1
@@ -91,7 +86,6 @@ dependencies:
91
86
  requirements:
92
87
  - - ">="
93
88
  - !ruby/object:Gem::Version
94
- hash: 11
95
89
  segments:
96
90
  - 0
97
91
  - 5
@@ -107,7 +101,6 @@ dependencies:
107
101
  requirements:
108
102
  - - ">="
109
103
  - !ruby/object:Gem::Version
110
- hash: 31
111
104
  segments:
112
105
  - 1
113
106
  - 0
@@ -115,7 +108,6 @@ dependencies:
115
108
  version: 1.0.4
116
109
  - - <=
117
110
  - !ruby/object:Gem::Version
118
- hash: 1
119
111
  segments:
120
112
  - 1
121
113
  - 5
@@ -131,7 +123,6 @@ dependencies:
131
123
  requirements:
132
124
  - - ">="
133
125
  - !ruby/object:Gem::Version
134
- hash: 7
135
126
  segments:
136
127
  - 0
137
128
  - 6
@@ -147,7 +138,6 @@ dependencies:
147
138
  requirements:
148
139
  - - <=
149
140
  - !ruby/object:Gem::Version
150
- hash: 3
151
141
  segments:
152
142
  - 1
153
143
  - 4
@@ -163,7 +153,6 @@ dependencies:
163
153
  requirements:
164
154
  - - ">="
165
155
  - !ruby/object:Gem::Version
166
- hash: 3
167
156
  segments:
168
157
  - 0
169
158
  version: "0"
@@ -177,7 +166,6 @@ dependencies:
177
166
  requirements:
178
167
  - - ">="
179
168
  - !ruby/object:Gem::Version
180
- hash: 3
181
169
  segments:
182
170
  - 0
183
171
  version: "0"
@@ -191,7 +179,6 @@ dependencies:
191
179
  requirements:
192
180
  - - ">="
193
181
  - !ruby/object:Gem::Version
194
- hash: 3
195
182
  segments:
196
183
  - 0
197
184
  version: "0"
@@ -205,7 +192,6 @@ dependencies:
205
192
  requirements:
206
193
  - - ">="
207
194
  - !ruby/object:Gem::Version
208
- hash: 3
209
195
  segments:
210
196
  - 0
211
197
  version: "0"
@@ -219,7 +205,6 @@ dependencies:
219
205
  requirements:
220
206
  - - ">="
221
207
  - !ruby/object:Gem::Version
222
- hash: 3
223
208
  segments:
224
209
  - 0
225
210
  version: "0"
@@ -338,6 +323,7 @@ files:
338
323
  - lib/chef/knife/data_bag_create.rb
339
324
  - lib/chef/knife/data_bag_delete.rb
340
325
  - lib/chef/knife/data_bag_edit.rb
326
+ - lib/chef/knife/data_bag_from_file.rb
341
327
  - lib/chef/knife/data_bag_list.rb
342
328
  - lib/chef/knife/data_bag_show.rb
343
329
  - lib/chef/knife/ec2_instance_data.rb
@@ -552,7 +538,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
552
538
  requirements:
553
539
  - - ">="
554
540
  - !ruby/object:Gem::Version
555
- hash: 3
556
541
  segments:
557
542
  - 0
558
543
  version: "0"
@@ -561,7 +546,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
561
546
  requirements:
562
547
  - - ">"
563
548
  - !ruby/object:Gem::Version
564
- hash: 25
565
549
  segments:
566
550
  - 1
567
551
  - 3