chef-zero 15.0.9 → 15.0.11
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/endpoints/policy_revision_endpoint.rb +44 -1
- data/lib/chef_zero/version.rb +1 -1
- data/spec/run_oc_pedant.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 726ae260c0156949d88bb48d7ac3846b50545f4275847c76efd1f31cff5c2d78
|
4
|
+
data.tar.gz: 8f7c4d509919162ab492d4b117f85f4303f38922942ab6eeafc27d4fa1913810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9bdf42f23dd2fb336f281fa3b148d6f1566488bcba8a171757519bfc63f74b4d371caae4c3eb2aca2fabec5032d2f4c4c5ad92ee22f7b35ac68a8fc15bb5c28
|
7
|
+
data.tar.gz: 7b6dc1ed42a4d873b6c5ac64030c69688cb8213a28da48efc02792ba9786b2728cc1bdaf297b905b70f917e0ff580ac97432bb0db4baca204839ca64262d1ccf
|
@@ -7,7 +7,50 @@ module ChefZero
|
|
7
7
|
# GET /organizations/ORG/policies/NAME/revisions/REVISION
|
8
8
|
def get(request)
|
9
9
|
data = parse_json(get_data(request))
|
10
|
-
|
10
|
+
|
11
|
+
# need to add another field in the response called 'policy_group_list'
|
12
|
+
# example response
|
13
|
+
# {
|
14
|
+
# "revision_id": "909c26701e291510eacdc6c06d626b9fa5350d25",
|
15
|
+
# "name": "some_policy_name",
|
16
|
+
# "run_list": [
|
17
|
+
# "recipe[policyfile_demo::default]"
|
18
|
+
# ],
|
19
|
+
# "cookbook_locks": {
|
20
|
+
# "policyfile_demo": {
|
21
|
+
# "identifier": "f04cc40faf628253fe7d9566d66a1733fb1afbe9",
|
22
|
+
# "version": "1.2.3"
|
23
|
+
# }
|
24
|
+
# },
|
25
|
+
# "policy_group_list": ["some_policy_group"]
|
26
|
+
# }
|
27
|
+
data[:policy_group_list] = Array.new
|
28
|
+
|
29
|
+
# extracting policy name and revision
|
30
|
+
request_policy_name = request.rest_path[3]
|
31
|
+
request_policy_revision = request.rest_path[5]
|
32
|
+
|
33
|
+
# updating the request to fetch the policy group list
|
34
|
+
request.rest_path[2] = "policy_groups"
|
35
|
+
request.rest_path = request.rest_path.slice(0,3)
|
36
|
+
|
37
|
+
list_data(request).each do |group_name|
|
38
|
+
group_path = request.rest_path + [group_name]
|
39
|
+
|
40
|
+
# fetching all the policies associated with each group
|
41
|
+
policy_list = list_data(request, group_path + ["policies"])
|
42
|
+
policy_list.each do |policy_name|
|
43
|
+
revision_id = parse_json(get_data(request, group_path + ["policies", policy_name]))
|
44
|
+
|
45
|
+
# if the name and revision matchs, we add the group to the response
|
46
|
+
if (policy_name == request_policy_name) && (revision_id == request_policy_revision)
|
47
|
+
policy_group_list = data[:policy_group_list]
|
48
|
+
data[:policy_group_list] = [group_name] + policy_group_list
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
data = ChefData::DataNormalizer.normalize_policy(data, request_policy_name, request_policy_revision)
|
11
54
|
json_response(200, data)
|
12
55
|
end
|
13
56
|
|
data/lib/chef_zero/version.rb
CHANGED
data/spec/run_oc_pedant.rb
CHANGED
@@ -191,7 +191,8 @@ begin
|
|
191
191
|
|
192
192
|
"--skip-status",
|
193
193
|
"--skip=email_case_insensitive",
|
194
|
-
"--skip=nginx_default_error"
|
194
|
+
"--skip=nginx_default_error",
|
195
|
+
"--skip=response_headers"
|
195
196
|
]
|
196
197
|
|
197
198
|
# The knife tests are very slow and don't give us a lot of extra coverage,
|
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: 15.0.
|
4
|
+
version: 15.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-log
|