chef-zero 4.4.0 → 4.4.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.
- checksums.yaml +4 -4
- data/lib/chef_zero/rspec.rb +15 -4
- data/lib/chef_zero/server.rb +19 -14
- data/lib/chef_zero/version.rb +1 -1
- data/spec/run_oc_pedant.rb +4 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d28e6a6bda690839d80bd54dce06e9e4bf320fe
|
4
|
+
data.tar.gz: 1858dce1cfdb1a48af5104b29352937ac9fb6138
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47705c89adc13d890d9d2454ad3fb4c0d1d451f57a91a593d4c5a31c29b94f06026abc93dbf8a1e73f2931c592833f80e853d6e86cb8a3c22f6e0da13ed1b13c
|
7
|
+
data.tar.gz: 6ae3097039e28c17ceded5a7811b8179c33392c22650450936225e6c81c2af343aceafa75c662862f9565b9f9718d87bf126ac8e4b50124b4de96e761c040338
|
data/lib/chef_zero/rspec.rb
CHANGED
@@ -125,8 +125,8 @@ module ChefZero
|
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
-
def cookbook_artifact(name, data, &block)
|
129
|
-
before(chef_server_options[:server_scope]) { cookbook_artifact(name, data, &block) }
|
128
|
+
def cookbook_artifact(name, identifier, data = {}, &block)
|
129
|
+
before(chef_server_options[:server_scope]) { cookbook_artifact(name, identifier, data, &block) }
|
130
130
|
end
|
131
131
|
|
132
132
|
def data_bag(name, data, &block)
|
@@ -215,6 +215,8 @@ module ChefZero
|
|
215
215
|
|
216
216
|
def cookbook(name, version, data = {}, options = {}, &block)
|
217
217
|
with_object_path("cookbooks/#{name}") do
|
218
|
+
# If you didn't specify metadata.rb, we generate it for you. If you
|
219
|
+
# explicitly set it to nil, that means you don't want it at all.
|
218
220
|
if data.has_key?('metadata.rb')
|
219
221
|
if data['metadata.rb'].nil?
|
220
222
|
data.delete('metadata.rb')
|
@@ -227,9 +229,18 @@ module ChefZero
|
|
227
229
|
end
|
228
230
|
end
|
229
231
|
|
230
|
-
def cookbook_artifact(name, identifier, data, &block)
|
232
|
+
def cookbook_artifact(name, identifier, data = {}, &block)
|
231
233
|
with_object_path("cookbook_artifacts/#{name}") do
|
232
|
-
|
234
|
+
# If you didn't specify metadata.rb, we generate it for you. If you
|
235
|
+
# explicitly set it to nil, that means you don't want it at all.
|
236
|
+
if data.has_key?('metadata.rb')
|
237
|
+
if data['metadata.rb'].nil?
|
238
|
+
data.delete('metadata.rb')
|
239
|
+
end
|
240
|
+
else
|
241
|
+
data['metadata.rb'] = "name #{name.inspect}"
|
242
|
+
end
|
243
|
+
ChefZero::RSpec.server.load_data({ 'cookbook_artifacts' => { "#{name}-#{identifier}" => data } }, current_org)
|
233
244
|
instance_eval(&block) if block_given?
|
234
245
|
end
|
235
246
|
end
|
data/lib/chef_zero/server.rb
CHANGED
@@ -473,20 +473,25 @@ module ChefZero
|
|
473
473
|
end
|
474
474
|
end
|
475
475
|
|
476
|
-
|
477
|
-
contents[
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
476
|
+
%w(cookbooks cookbook_artifacts).each do |cookbook_type|
|
477
|
+
if contents[cookbook_type]
|
478
|
+
contents[cookbook_type].each_pair do |name_version, cookbook|
|
479
|
+
if cookbook_type == 'cookbook_artifacts'
|
480
|
+
name, dash, identifier = name_version.rpartition('-')
|
481
|
+
cookbook_data = ChefData::CookbookData.to_hash(cookbook, name, identifier)
|
482
|
+
elsif name_version =~ /(.+)-(\d+\.\d+\.\d+)$/
|
483
|
+
cookbook_data = ChefData::CookbookData.to_hash(cookbook, $1, $2)
|
484
|
+
else
|
485
|
+
cookbook_data = ChefData::CookbookData.to_hash(cookbook, name_version)
|
486
|
+
end
|
487
|
+
raise "No version specified" if !cookbook_data[:version]
|
488
|
+
data_store.create_dir(['organizations', org_name, cookbook_type], cookbook_data[:cookbook_name], :recursive)
|
489
|
+
data_store.set(['organizations', org_name, cookbook_type, cookbook_data[:cookbook_name], cookbook_data[:version]], FFI_Yajl::Encoder.encode(cookbook_data, :pretty => true), :create)
|
490
|
+
cookbook_data.values.each do |files|
|
491
|
+
next unless files.is_a? Array
|
492
|
+
files.each do |file|
|
493
|
+
data_store.set(['organizations', org_name, 'file_store', 'checksums', file[:checksum]], get_file(cookbook, file[:path]), :create)
|
494
|
+
end
|
490
495
|
end
|
491
496
|
end
|
492
497
|
end
|
data/lib/chef_zero/version.rb
CHANGED
data/spec/run_oc_pedant.rb
CHANGED
@@ -108,7 +108,10 @@ begin
|
|
108
108
|
|
109
109
|
# Chef 12 features not yet 100% supported by Chef Zero
|
110
110
|
'--skip-containers',
|
111
|
-
'--skip-api-v1'
|
111
|
+
'--skip-api-v1',
|
112
|
+
|
113
|
+
# The universe endpoint is unlikely to ever make sense for Chef Zero
|
114
|
+
'--skip-universe'
|
112
115
|
] + chef_fs_skips)
|
113
116
|
|
114
117
|
fail_fast = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.
|
4
|
+
version: 4.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Keiser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-log
|
@@ -309,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
309
309
|
version: '0'
|
310
310
|
requirements: []
|
311
311
|
rubyforge_project:
|
312
|
-
rubygems_version: 2.
|
312
|
+
rubygems_version: 2.5.0
|
313
313
|
signing_key:
|
314
314
|
specification_version: 4
|
315
315
|
summary: Self-contained, easy-setup, fast-start in-memory Chef server for testing
|