chef-zero 2.1 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef_zero/data_store/v1_to_v2_adapter.rb +16 -18
- data/lib/chef_zero/server.rb +2 -3
- data/lib/chef_zero/version.rb +1 -1
- data/spec/run.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06ef2b090b7ac3eed283205f44d61cd66c693c74
|
4
|
+
data.tar.gz: 14fb6b29d392f772e579685056499a4e053cf5eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a2192f2a50b203f19e6b45e8d911fb0fb304a5771b0721e49e47b587df40d33f53bdd59a8a83f119815929087f9b0aa2002ba983e9497c79c5e0f33c47d557
|
7
|
+
data.tar.gz: a82c744dbbacbc2841e8d11f9fdd17748393c8d1b9a5b8e713ce87876a521fc6ae3a8d0b55abb78a81e2fd8f84f9450ea1e7f190b4c12a0df32ee1d152a73d26
|
@@ -3,27 +3,25 @@ require 'chef_zero/data_store/interface_v2'
|
|
3
3
|
module ChefZero
|
4
4
|
module DataStore
|
5
5
|
class V1ToV2Adapter < ChefZero::DataStore::InterfaceV2
|
6
|
-
def initialize(real_store, single_org)
|
6
|
+
def initialize(real_store, single_org, options = {})
|
7
7
|
@real_store = real_store
|
8
8
|
@single_org = single_org
|
9
|
-
|
10
|
-
@defaults = {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
24
|
-
}
|
9
|
+
org_defaults = options[:org_defaults] || {}
|
10
|
+
@defaults = { 'organizations' => { single_org => org_defaults }}
|
11
|
+
end
|
12
|
+
|
13
|
+
ORG_DEFAULTS = {
|
14
|
+
'clients' => {
|
15
|
+
'chef-validator' => '{ "validator": true }',
|
16
|
+
'chef-webui' => '{ "admin": true }'
|
17
|
+
},
|
18
|
+
'environments' => {
|
19
|
+
'_default' => '{ "description": "The default Chef environment" }'
|
20
|
+
},
|
21
|
+
'users' => {
|
22
|
+
'admin' => '{ "admin": "true" }'
|
25
23
|
}
|
26
|
-
|
24
|
+
}
|
27
25
|
|
28
26
|
attr_reader :real_store
|
29
27
|
attr_reader :single_org
|
data/lib/chef_zero/server.rb
CHANGED
@@ -95,9 +95,9 @@ module ChefZero
|
|
95
95
|
#
|
96
96
|
def url
|
97
97
|
@url ||= if @options[:host].include?(':')
|
98
|
-
"http://[#{@options[:host]}]:#{@options[:port]}"
|
98
|
+
URI("http://[#{@options[:host]}]:#{@options[:port]}").to_s
|
99
99
|
else
|
100
|
-
"http://#{@options[:host]}:#{@options[:port]}"
|
100
|
+
URI("http://#{@options[:host]}:#{@options[:port]}").to_s
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
@@ -284,7 +284,6 @@ module ChefZero
|
|
284
284
|
# }
|
285
285
|
# }
|
286
286
|
def load_data(contents, org_name = 'chef')
|
287
|
-
data_store.create_dir('organizations', org_name)
|
288
287
|
%w(clients environments nodes roles users).each do |data_type|
|
289
288
|
if contents[data_type]
|
290
289
|
dejsonize_children(contents[data_type]).each_pair do |name, data|
|
data/lib/chef_zero/version.rb
CHANGED
data/spec/run.rb
CHANGED
@@ -23,6 +23,7 @@ def start_server(chef_repo_path)
|
|
23
23
|
Chef::Config.versioned_cookbooks = true
|
24
24
|
chef_fs = Chef::ChefFS::Config.new.local_fs
|
25
25
|
data_store = Chef::ChefFS::ChefFSDataStore.new(chef_fs)
|
26
|
+
data_store = ChefZero::DataStore::V1ToV2Adapter.new(data_store, 'chef', :org_defaults => ChefZero::DataStore::V1ToV2Adapter::ORG_DEFAULTS)
|
26
27
|
server = ChefZero::Server.new(:port => 8889, :data_store => data_store)#, :log_level => :debug)
|
27
28
|
server.start_background
|
28
29
|
server
|
@@ -35,6 +36,7 @@ begin
|
|
35
36
|
require 'tmpdir'
|
36
37
|
require 'fileutils'
|
37
38
|
require 'chef/version'
|
39
|
+
require 'chef_zero/data_store/v1_to_v2_adapter'
|
38
40
|
|
39
41
|
# Create chef repository
|
40
42
|
tmpdir = Dir.mktmpdir
|
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
|
+
version: 2.1.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: 2014-05-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-log
|