chef-zero 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,7 @@ module ChefZero
|
|
34
34
|
|
35
35
|
# Filter by environment constraints
|
36
36
|
environment = JSON.parse(get_data(request, request.rest_path[0..1]), :create_additions => false)
|
37
|
-
environment_constraints = environment['cookbook_versions']
|
37
|
+
environment_constraints = environment['cookbook_versions'] || {}
|
38
38
|
|
39
39
|
desired_versions.each_key do |name|
|
40
40
|
desired_versions = filter_by_constraint(desired_versions, name, environment_constraints[name])
|
@@ -48,7 +48,8 @@ module ChefZero
|
|
48
48
|
|
49
49
|
result = {}
|
50
50
|
solved.each_pair do |name, versions|
|
51
|
-
|
51
|
+
cookbook = JSON.parse(data['cookbooks'][name][versions[0]], :create_additions => false)
|
52
|
+
result[name] = DataNormalizer.normalize_cookbook(cookbook, name, versions[0], request.base_uri, 'GET')
|
52
53
|
end
|
53
54
|
json_response(200, result)
|
54
55
|
end
|
@@ -69,8 +70,10 @@ module ChefZero
|
|
69
70
|
|
70
71
|
# Pick this cookbook, and add dependencies
|
71
72
|
cookbook_obj = JSON.parse(cookbooks[solve_for][desired_version], :create_additions => false)
|
73
|
+
cookbook_metadata = cookbook_obj['metadata'] || {}
|
74
|
+
cookbook_dependencies = cookbook_metadata['dependencies'] || {}
|
72
75
|
dep_not_found = false
|
73
|
-
|
76
|
+
cookbook_dependencies.each_pair do |dep_name, dep_constraint|
|
74
77
|
# If the dep is not already in the list, add it to the list to solve
|
75
78
|
# and bring in all environment-allowed cookbook versions to desired_versions
|
76
79
|
if !new_desired_versions.has_key?(dep_name)
|
data/lib/chef_zero/version.rb
CHANGED