chef-zero 14.0.13 → 14.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -6
  3. data/Rakefile +9 -1
  4. data/chef-zero.gemspec +1 -4
  5. data/lib/chef_zero.rb +1 -1
  6. data/lib/chef_zero/chef_data/cookbook_data.rb +1 -1
  7. data/lib/chef_zero/chef_data/data_normalizer.rb +9 -7
  8. data/lib/chef_zero/chef_data/default_creator.rb +8 -5
  9. data/lib/chef_zero/data_store/data_already_exists_error.rb +1 -1
  10. data/lib/chef_zero/data_store/data_error.rb +1 -1
  11. data/lib/chef_zero/data_store/data_not_found_error.rb +1 -1
  12. data/lib/chef_zero/data_store/default_facade.rb +4 -4
  13. data/lib/chef_zero/data_store/interface_v2.rb +1 -1
  14. data/lib/chef_zero/data_store/memory_store.rb +3 -3
  15. data/lib/chef_zero/data_store/memory_store_v2.rb +22 -14
  16. data/lib/chef_zero/data_store/raw_file_store.rb +6 -4
  17. data/lib/chef_zero/data_store/v1_to_v2_adapter.rb +11 -1
  18. data/lib/chef_zero/data_store/v2_to_v1_adapter.rb +1 -1
  19. data/lib/chef_zero/endpoints/acl_endpoint.rb +3 -2
  20. data/lib/chef_zero/endpoints/acls_endpoint.rb +5 -4
  21. data/lib/chef_zero/endpoints/actor_default_key_endpoint.rb +2 -1
  22. data/lib/chef_zero/endpoints/actor_endpoint.rb +3 -3
  23. data/lib/chef_zero/endpoints/actor_key_endpoint.rb +1 -1
  24. data/lib/chef_zero/endpoints/actor_keys_endpoint.rb +3 -2
  25. data/lib/chef_zero/endpoints/actors_endpoint.rb +1 -1
  26. data/lib/chef_zero/endpoints/authenticate_user_endpoint.rb +2 -1
  27. data/lib/chef_zero/endpoints/container_endpoint.rb +2 -2
  28. data/lib/chef_zero/endpoints/containers_endpoint.rb +2 -2
  29. data/lib/chef_zero/endpoints/controls_endpoint.rb +1 -1
  30. data/lib/chef_zero/endpoints/cookbook_artifact_endpoint.rb +1 -1
  31. data/lib/chef_zero/endpoints/cookbook_artifact_identifier_endpoint.rb +3 -3
  32. data/lib/chef_zero/endpoints/cookbook_artifacts_endpoint.rb +1 -1
  33. data/lib/chef_zero/endpoints/cookbook_endpoint.rb +1 -1
  34. data/lib/chef_zero/endpoints/cookbook_version_endpoint.rb +7 -5
  35. data/lib/chef_zero/endpoints/cookbooks_base.rb +4 -2
  36. data/lib/chef_zero/endpoints/cookbooks_endpoint.rb +1 -1
  37. data/lib/chef_zero/endpoints/data_bag_endpoint.rb +3 -3
  38. data/lib/chef_zero/endpoints/data_bag_item_endpoint.rb +3 -3
  39. data/lib/chef_zero/endpoints/data_bags_endpoint.rb +2 -2
  40. data/lib/chef_zero/endpoints/environment_cookbook_endpoint.rb +1 -1
  41. data/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb +13 -10
  42. data/lib/chef_zero/endpoints/environment_cookbooks_endpoint.rb +1 -1
  43. data/lib/chef_zero/endpoints/environment_endpoint.rb +2 -2
  44. data/lib/chef_zero/endpoints/environment_nodes_endpoint.rb +1 -1
  45. data/lib/chef_zero/endpoints/environment_recipes_endpoint.rb +1 -1
  46. data/lib/chef_zero/endpoints/environment_role_endpoint.rb +1 -1
  47. data/lib/chef_zero/endpoints/file_store_file_endpoint.rb +1 -1
  48. data/lib/chef_zero/endpoints/group_endpoint.rb +2 -2
  49. data/lib/chef_zero/endpoints/groups_endpoint.rb +1 -1
  50. data/lib/chef_zero/endpoints/license_endpoint.rb +1 -1
  51. data/lib/chef_zero/endpoints/node_endpoint.rb +2 -2
  52. data/lib/chef_zero/endpoints/node_identifiers_endpoint.rb +1 -1
  53. data/lib/chef_zero/endpoints/nodes_endpoint.rb +2 -2
  54. data/lib/chef_zero/endpoints/not_found_endpoint.rb +1 -1
  55. data/lib/chef_zero/endpoints/organization_association_request_endpoint.rb +2 -1
  56. data/lib/chef_zero/endpoints/organization_association_requests_endpoint.rb +1 -1
  57. data/lib/chef_zero/endpoints/organization_authenticate_user_endpoint.rb +1 -1
  58. data/lib/chef_zero/endpoints/organization_endpoint.rb +3 -2
  59. data/lib/chef_zero/endpoints/organization_user_base.rb +1 -1
  60. data/lib/chef_zero/endpoints/organization_user_default_key_endpoint.rb +1 -1
  61. data/lib/chef_zero/endpoints/organization_user_endpoint.rb +1 -1
  62. data/lib/chef_zero/endpoints/organization_user_key_endpoint.rb +2 -2
  63. data/lib/chef_zero/endpoints/organization_user_keys_endpoint.rb +1 -1
  64. data/lib/chef_zero/endpoints/organization_users_endpoint.rb +2 -2
  65. data/lib/chef_zero/endpoints/organization_validator_key_endpoint.rb +1 -1
  66. data/lib/chef_zero/endpoints/organizations_endpoint.rb +1 -1
  67. data/lib/chef_zero/endpoints/policies_endpoint.rb +1 -1
  68. data/lib/chef_zero/endpoints/policy_endpoint.rb +1 -1
  69. data/lib/chef_zero/endpoints/policy_group_endpoint.rb +2 -2
  70. data/lib/chef_zero/endpoints/policy_group_policy_endpoint.rb +3 -3
  71. data/lib/chef_zero/endpoints/policy_groups_endpoint.rb +2 -2
  72. data/lib/chef_zero/endpoints/policy_revision_endpoint.rb +1 -1
  73. data/lib/chef_zero/endpoints/policy_revisions_endpoint.rb +1 -1
  74. data/lib/chef_zero/endpoints/principal_endpoint.rb +2 -2
  75. data/lib/chef_zero/endpoints/rest_list_endpoint.rb +2 -2
  76. data/lib/chef_zero/endpoints/rest_object_endpoint.rb +3 -2
  77. data/lib/chef_zero/endpoints/role_endpoint.rb +2 -2
  78. data/lib/chef_zero/endpoints/role_environments_endpoint.rb +1 -1
  79. data/lib/chef_zero/endpoints/sandbox_endpoint.rb +3 -3
  80. data/lib/chef_zero/endpoints/sandboxes_endpoint.rb +1 -1
  81. data/lib/chef_zero/endpoints/search_endpoint.rb +8 -8
  82. data/lib/chef_zero/endpoints/searches_endpoint.rb +1 -1
  83. data/lib/chef_zero/endpoints/server_api_version_endpoint.rb +1 -1
  84. data/lib/chef_zero/endpoints/system_recovery_endpoint.rb +3 -3
  85. data/lib/chef_zero/endpoints/universe_endpoint.rb +2 -2
  86. data/lib/chef_zero/endpoints/user_association_request_endpoint.rb +2 -1
  87. data/lib/chef_zero/endpoints/user_association_requests_count_endpoint.rb +1 -1
  88. data/lib/chef_zero/endpoints/user_association_requests_endpoint.rb +1 -1
  89. data/lib/chef_zero/endpoints/user_organizations_endpoint.rb +1 -1
  90. data/lib/chef_zero/endpoints/version_endpoint.rb +2 -2
  91. data/lib/chef_zero/rest_base.rb +15 -15
  92. data/lib/chef_zero/rest_request.rb +4 -4
  93. data/lib/chef_zero/rest_router.rb +2 -2
  94. data/lib/chef_zero/rspec.rb +3 -2
  95. data/lib/chef_zero/server.rb +87 -83
  96. data/lib/chef_zero/socketless_server_map.rb +2 -1
  97. data/lib/chef_zero/solr/query/phrase.rb +2 -2
  98. data/lib/chef_zero/solr/query/range_query.rb +3 -3
  99. data/lib/chef_zero/solr/query/term.rb +1 -1
  100. data/lib/chef_zero/solr/solr_parser.rb +12 -10
  101. data/lib/chef_zero/version.rb +1 -1
  102. data/spec/run_oc_pedant.rb +5 -3
  103. data/spec/search_spec.rb +2 -2
  104. data/spec/socketless_server_map_spec.rb +1 -1
  105. data/spec/support/oc_pedant.rb +1 -1
  106. metadata +3 -31
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = "14.0.13".freeze
2
+ VERSION = "14.0.17".freeze
3
3
  end
@@ -32,6 +32,7 @@ DEFAULT_LOG_LEVEL = :warn
32
32
  def log_level
33
33
  return ENV["LOG_LEVEL"].downcase.to_sym if ENV["LOG_LEVEL"]
34
34
  return :debug if ENV["DEBUG"]
35
+
35
36
  DEFAULT_LOG_LEVEL
36
37
  end
37
38
 
@@ -39,7 +40,7 @@ def start_chef_server(opts = {})
39
40
  opts = DEFAULT_SERVER_OPTIONS.merge(opts)
40
41
  opts[:log_level] = log_level
41
42
 
42
- ChefZero::Server.new(opts).tap { |server| server.start_background }
43
+ ChefZero::Server.new(opts).tap(&:start_background)
43
44
  end
44
45
 
45
46
  def start_cheffs_server(chef_repo_path)
@@ -49,12 +50,12 @@ def start_cheffs_server(chef_repo_path)
49
50
  require "chef/chef_fs/chef_fs_data_store"
50
51
  require "chef_zero/server"
51
52
 
52
- Dir.mkdir(chef_repo_path) if !File.exist?(chef_repo_path)
53
+ Dir.mkdir(chef_repo_path) unless File.exist?(chef_repo_path)
53
54
 
54
55
  # 11.6 and below had a bug where it couldn't create the repo children automatically
55
56
  if Chef::VERSION.to_f < 11.8
56
57
  %w{clients cookbooks data_bags environments nodes roles users}.each do |child|
57
- Dir.mkdir("#{chef_repo_path}/#{child}") if !File.exist?("#{chef_repo_path}/#{child}")
58
+ Dir.mkdir("#{chef_repo_path}/#{child}") unless File.exist?("#{chef_repo_path}/#{child}")
58
59
  end
59
60
  end
60
61
 
@@ -84,6 +85,7 @@ end
84
85
 
85
86
  def args_from_env(key)
86
87
  return [] unless ENV[key]
88
+
87
89
  ENV[key].split
88
90
  end
89
91
 
@@ -6,8 +6,8 @@ describe ChefZero::Solr::SolrParser do
6
6
  docs = []
7
7
  [{ "foo" => "a" },
8
8
  { "foo" => "d" }].each_with_index do |h, i|
9
- docs.push ChefZero::Solr::SolrDoc.new(h, i)
10
- end
9
+ docs.push ChefZero::Solr::SolrDoc.new(h, i)
10
+ end
11
11
  docs
12
12
  end
13
13
 
@@ -2,7 +2,7 @@ require "chef_zero/socketless_server_map"
2
2
 
3
3
  describe "Socketless Mode" do
4
4
 
5
- let(:server_map) { ChefZero::SocketlessServerMap.instance.tap { |i| i.reset! } }
5
+ let(:server_map) { ChefZero::SocketlessServerMap.instance.tap(&:reset!) }
6
6
 
7
7
  let(:server) { instance_double("ChefZero::Server") }
8
8
 
@@ -140,7 +140,7 @@ requestors({
140
140
  },
141
141
  })
142
142
 
143
- self[:tags] = [:validation, :authentication, :authorization]
143
+ self[:tags] = %i{validation authentication authorization}
144
144
  verify_error_messages false
145
145
 
146
146
  ruby_users_endpoint? false
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: 14.0.13
4
+ version: 14.0.17
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: 2019-10-07 00:00:00.000000000 Z
11
+ date: 2019-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -98,34 +98,6 @@ dependencies:
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
100
  version: 2.0.6
101
- - !ruby/object:Gem::Dependency
102
- name: rake
103
- requirement: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: '0'
108
- type: :development
109
- prerelease: false
110
- version_requirements: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: '0'
115
- - !ruby/object:Gem::Dependency
116
- name: rspec
117
- requirement: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- version: '0'
122
- type: :development
123
- prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: '0'
129
101
  description: Self-contained, easy-setup, fast-start in-memory Chef server for testing
130
102
  and solo setup purposes
131
103
  email: oss@chef.io
@@ -266,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
266
238
  requirements:
267
239
  - - ">="
268
240
  - !ruby/object:Gem::Version
269
- version: 2.4.0
241
+ version: '2.4'
270
242
  required_rubygems_version: !ruby/object:Gem::Requirement
271
243
  requirements:
272
244
  - - ">="