puppet 6.4.4-universal-darwin → 6.4.5-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/CODEOWNERS +1 -1
  3. data/Gemfile +4 -4
  4. data/Gemfile.lock +38 -32
  5. data/ext/build_defaults.yaml +1 -0
  6. data/ext/cert_inspector +3 -3
  7. data/ext/puppet-test +2 -2
  8. data/ext/regexp_nodes/regexp_nodes.rb +4 -4
  9. data/ext/windows/service/daemon.rb +38 -8
  10. data/install.rb +6 -6
  11. data/lib/puppet/application.rb +1 -1
  12. data/lib/puppet/application/apply.rb +2 -2
  13. data/lib/puppet/application/describe.rb +3 -9
  14. data/lib/puppet/application/doc.rb +1 -1
  15. data/lib/puppet/application/lookup.rb +1 -1
  16. data/lib/puppet/application/script.rb +2 -2
  17. data/lib/puppet/application/ssl.rb +4 -1
  18. data/lib/puppet/configurer.rb +86 -30
  19. data/lib/puppet/configurer/downloader.rb +2 -6
  20. data/lib/puppet/defaults.rb +32 -6
  21. data/lib/puppet/error.rb +9 -1
  22. data/lib/puppet/face/module/list.rb +5 -5
  23. data/lib/puppet/face/module/search.rb +1 -1
  24. data/lib/puppet/face/module/uninstall.rb +1 -1
  25. data/lib/puppet/face/module/upgrade.rb +1 -1
  26. data/lib/puppet/file_serving/http_metadata.rb +1 -1
  27. data/lib/puppet/file_system.rb +0 -8
  28. data/lib/puppet/file_system/memory_file.rb +1 -1
  29. data/lib/puppet/file_system/posix.rb +3 -2
  30. data/lib/puppet/forge.rb +3 -3
  31. data/lib/puppet/functions.rb +1 -2
  32. data/lib/puppet/functions/camelcase.rb +2 -2
  33. data/lib/puppet/functions/epp.rb +4 -4
  34. data/lib/puppet/functions/find_file.rb +9 -9
  35. data/lib/puppet/functions/inline_epp.rb +5 -5
  36. data/lib/puppet/gettext/module_translations.rb +1 -1
  37. data/lib/puppet/graph/rb_tree_map.rb +2 -2
  38. data/lib/puppet/graph/simple_graph.rb +4 -3
  39. data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
  40. data/lib/puppet/indirector/hiera.rb +2 -0
  41. data/lib/puppet/indirector/resource/ral.rb +1 -3
  42. data/lib/puppet/indirector/resource/validator.rb +1 -1
  43. data/lib/puppet/interface.rb +2 -1
  44. data/lib/puppet/loaders.rb +0 -1
  45. data/lib/puppet/metatype/manager.rb +1 -1
  46. data/lib/puppet/module.rb +1 -1
  47. data/lib/puppet/module/task.rb +20 -4
  48. data/lib/puppet/module_tool/applications/installer.rb +1 -1
  49. data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
  50. data/lib/puppet/module_tool/metadata.rb +1 -1
  51. data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
  52. data/lib/puppet/module_tool/tar/mini.rb +1 -1
  53. data/lib/puppet/network/http/api/indirected_routes.rb +12 -11
  54. data/lib/puppet/network/http/connection.rb +10 -12
  55. data/lib/puppet/network/http/pool.rb +2 -0
  56. data/lib/puppet/network/http/site.rb +1 -1
  57. data/lib/puppet/network/resolver.rb +2 -2
  58. data/lib/puppet/node/environment.rb +4 -2
  59. data/lib/puppet/pal/pal_impl.rb +2 -2
  60. data/lib/puppet/parser/ast.rb +1 -1
  61. data/lib/puppet/parser/ast/resourceparam.rb +1 -1
  62. data/lib/puppet/parser/functions.rb +1 -1
  63. data/lib/puppet/parser/functions/epp.rb +3 -3
  64. data/lib/puppet/parser/functions/inline_epp.rb +5 -5
  65. data/lib/puppet/parser/scope.rb +8 -7
  66. data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
  67. data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
  68. data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
  69. data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
  70. data/lib/puppet/pops/loader/task_instantiator.rb +4 -0
  71. data/lib/puppet/pops/loaders.rb +1 -1
  72. data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
  73. data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
  74. data/lib/puppet/pops/merge_strategy.rb +22 -18
  75. data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  76. data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
  77. data/lib/puppet/pops/parser/locator.rb +1 -1
  78. data/lib/puppet/pops/parser/pn_parser.rb +17 -16
  79. data/lib/puppet/pops/puppet_stack.rb +51 -49
  80. data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
  81. data/lib/puppet/pops/types/string_converter.rb +10 -10
  82. data/lib/puppet/pops/types/types.rb +3 -3
  83. data/lib/puppet/property.rb +1 -1
  84. data/lib/puppet/property/ensure.rb +1 -1
  85. data/lib/puppet/provider/exec.rb +6 -2
  86. data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
  87. data/lib/puppet/provider/nameservice/pw.rb +2 -2
  88. data/lib/puppet/provider/package/apt.rb +5 -1
  89. data/lib/puppet/provider/package/dnfmodule.rb +87 -0
  90. data/lib/puppet/provider/package/dpkg.rb +34 -18
  91. data/lib/puppet/provider/package/openbsd.rb +1 -1
  92. data/lib/puppet/provider/package/pip.rb +34 -9
  93. data/lib/puppet/provider/package/portage.rb +4 -4
  94. data/lib/puppet/provider/package/rpm.rb +5 -5
  95. data/lib/puppet/provider/package/windows/package.rb +1 -1
  96. data/lib/puppet/provider/package/yum.rb +1 -1
  97. data/lib/puppet/provider/package_targetable.rb +5 -4
  98. data/lib/puppet/provider/parsedfile.rb +1 -1
  99. data/lib/puppet/provider/service/daemontools.rb +9 -9
  100. data/lib/puppet/provider/service/openbsd.rb +1 -1
  101. data/lib/puppet/provider/service/rcng.rb +2 -2
  102. data/lib/puppet/provider/service/runit.rb +2 -8
  103. data/lib/puppet/provider/service/systemd.rb +9 -9
  104. data/lib/puppet/provider/user/directoryservice.rb +1 -1
  105. data/lib/puppet/provider/user/hpux.rb +1 -1
  106. data/lib/puppet/provider/user/user_role_add.rb +1 -1
  107. data/lib/puppet/provider/user/useradd.rb +22 -13
  108. data/lib/puppet/provider/user/windows_adsi.rb +4 -5
  109. data/lib/puppet/reference/indirection.rb +2 -2
  110. data/lib/puppet/reference/metaparameter.rb +1 -3
  111. data/lib/puppet/reference/providers.rb +1 -3
  112. data/lib/puppet/reference/type.rb +3 -9
  113. data/lib/puppet/reports.rb +1 -1
  114. data/lib/puppet/resource.rb +1 -1
  115. data/lib/puppet/resource/catalog.rb +1 -1
  116. data/lib/puppet/settings.rb +3 -3
  117. data/lib/puppet/settings/environment_conf.rb +1 -0
  118. data/lib/puppet/ssl/host.rb +1 -1
  119. data/lib/puppet/ssl/oids.rb +1 -1
  120. data/lib/puppet/transaction.rb +33 -11
  121. data/lib/puppet/transaction/report.rb +1 -1
  122. data/lib/puppet/type.rb +2 -4
  123. data/lib/puppet/type/exec.rb +7 -3
  124. data/lib/puppet/type/file.rb +1 -2
  125. data/lib/puppet/type/file/data_sync.rb +5 -1
  126. data/lib/puppet/type/group.rb +4 -2
  127. data/lib/puppet/type/notify.rb +3 -2
  128. data/lib/puppet/type/package.rb +10 -3
  129. data/lib/puppet/type/schedule.rb +1 -1
  130. data/lib/puppet/type/service.rb +1 -1
  131. data/lib/puppet/type/user.rb +4 -2
  132. data/lib/puppet/util.rb +35 -12
  133. data/lib/puppet/util/command_line/trollop.rb +1 -1
  134. data/lib/puppet/util/http_proxy.rb +8 -14
  135. data/lib/puppet/util/log.rb +2 -2
  136. data/lib/puppet/util/log/destinations.rb +2 -2
  137. data/lib/puppet/util/logging.rb +32 -20
  138. data/lib/puppet/util/metric.rb +2 -2
  139. data/lib/puppet/util/provider_features.rb +2 -4
  140. data/lib/puppet/util/rdoc.rb +1 -1
  141. data/lib/puppet/util/reference.rb +1 -1
  142. data/lib/puppet/util/resource_template.rb +1 -1
  143. data/lib/puppet/util/selinux.rb +3 -1
  144. data/lib/puppet/util/windows/adsi.rb +48 -18
  145. data/lib/puppet/util/windows/registry.rb +7 -5
  146. data/lib/puppet/vendor.rb +1 -1
  147. data/lib/puppet/version.rb +1 -1
  148. data/lib/puppet/x509/cert_provider.rb +13 -6
  149. data/locales/puppet.pot +199 -159
  150. data/man/man5/puppet.conf.5 +35 -5
  151. data/man/man8/puppet-agent.8 +1 -1
  152. data/man/man8/puppet-apply.8 +1 -1
  153. data/man/man8/puppet-catalog.8 +1 -1
  154. data/man/man8/puppet-config.8 +1 -1
  155. data/man/man8/puppet-describe.8 +1 -1
  156. data/man/man8/puppet-device.8 +1 -1
  157. data/man/man8/puppet-doc.8 +1 -1
  158. data/man/man8/puppet-epp.8 +1 -1
  159. data/man/man8/puppet-facts.8 +1 -1
  160. data/man/man8/puppet-filebucket.8 +1 -1
  161. data/man/man8/puppet-generate.8 +1 -1
  162. data/man/man8/puppet-help.8 +1 -1
  163. data/man/man8/puppet-key.8 +1 -1
  164. data/man/man8/puppet-lookup.8 +1 -1
  165. data/man/man8/puppet-man.8 +1 -1
  166. data/man/man8/puppet-module.8 +1 -1
  167. data/man/man8/puppet-node.8 +1 -1
  168. data/man/man8/puppet-parser.8 +1 -1
  169. data/man/man8/puppet-plugin.8 +1 -1
  170. data/man/man8/puppet-report.8 +1 -1
  171. data/man/man8/puppet-resource.8 +1 -1
  172. data/man/man8/puppet-script.8 +1 -1
  173. data/man/man8/puppet-ssl.8 +1 -1
  174. data/man/man8/puppet-status.8 +1 -1
  175. data/man/man8/puppet.8 +2 -2
  176. data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +11 -0
  177. data/spec/integration/configurer_spec.rb +52 -0
  178. data/spec/integration/type/notify_spec.rb +46 -0
  179. data/spec/lib/puppet/certificate_factory.rb +2 -2
  180. data/spec/spec_helper.rb +28 -0
  181. data/spec/unit/application/ssl_spec.rb +4 -7
  182. data/spec/unit/configurer_spec.rb +394 -398
  183. data/spec/unit/defaults_spec.rb +4 -4
  184. data/spec/unit/forge/forge_spec.rb +1 -3
  185. data/spec/unit/forge/repository_spec.rb +1 -3
  186. data/spec/unit/indirector/resource/ral_spec.rb +4 -4
  187. data/spec/unit/network/http/connection_spec.rb +119 -145
  188. data/spec/unit/parser/scope_spec.rb +10 -0
  189. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +8 -3
  190. data/spec/unit/pops/loaders/module_loaders_spec.rb +37 -0
  191. data/spec/unit/provider/exec_spec.rb +209 -0
  192. data/spec/unit/provider/package/dnfmodule_spec.rb +186 -0
  193. data/spec/unit/provider/package/dpkg_spec.rb +238 -78
  194. data/spec/unit/provider/package/pip_spec.rb +51 -6
  195. data/spec/unit/provider/package/portage_spec.rb +4 -4
  196. data/spec/unit/provider/package_targetable_spec.rb +60 -0
  197. data/spec/unit/provider/service/daemontools_spec.rb +24 -0
  198. data/spec/unit/provider/service/runit_spec.rb +24 -0
  199. data/spec/unit/provider/service/systemd_spec.rb +25 -25
  200. data/spec/unit/provider/user/hpux_spec.rb +2 -2
  201. data/spec/unit/provider/user/useradd_spec.rb +46 -0
  202. data/spec/unit/ssl/host_spec.rb +0 -5
  203. data/spec/unit/ssl/state_machine_spec.rb +0 -6
  204. data/spec/unit/transaction_spec.rb +46 -0
  205. data/spec/unit/type/exec_spec.rb +6 -12
  206. data/spec/unit/type/file/content_spec.rb +9 -3
  207. data/spec/unit/type/file_spec.rb +9 -4
  208. data/spec/unit/type/package_spec.rb +5 -0
  209. data/spec/unit/util/execution_spec.rb +16 -0
  210. data/spec/unit/util/http_proxy_spec.rb +118 -27
  211. data/spec/unit/util/log/destinations_spec.rb +7 -3
  212. data/spec/unit/util/log_spec.rb +0 -138
  213. data/spec/unit/util/logging_spec.rb +200 -0
  214. data/spec/unit/util/windows/adsi_spec.rb +51 -0
  215. data/spec/unit/x509/cert_provider_spec.rb +24 -4
  216. data/tasks/manpages.rake +1 -0
  217. metadata +12 -10
  218. data/lib/puppet/pops/loader/null_loader.rb +0 -60
  219. data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml +0 -24
  220. data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml +0 -24
  221. data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1dd4ef7b5a057b03a738a7fa1539ff575df455bbfa76539725dc2180287b6ac1
4
- data.tar.gz: 1d1046c2c733c7c94bc633ce95a21d02a7e4a94ded83b3ffd2c4210aa4e079b6
3
+ metadata.gz: 6cb125300310704ec95a54c6bcf1e195ed8d0aa6ca03f6171a6e30cea6b6f61b
4
+ data.tar.gz: b76664e8a7f316dcc2367f426253a6592b369a157610c1dbcac9ba41c1089fff
5
5
  SHA512:
6
- metadata.gz: 1a23a885b450a63b64cce6b168b88b58d949780bb8e261e2f5bab522860578dc33a3a7c8d29352c46002229d12292bbd486d5b79c3c7688cac5aea00ea8446da
7
- data.tar.gz: 5d8bb617053c42a3b473ecfe95552641be348a44aa95ea7a021aec0e0c8a3d1a0f779d188a1ade227a7297ae714c6300143dd30f0017362e878d52b7b7eac8c6
6
+ metadata.gz: 2eeb6fb7b242abceb8ccd7e7cd6c52d740cb065298d0bf34c5f6d16c706983b78d54f6d4da121e809495a87213936bd6fc21367541ffb1ba6d10db068f8a270e
7
+ data.tar.gz: 4e29b2278d891d545ac9996a9dc183bfb538ba70497c4a542fbdc6eac6955d89b2e65b98af2f34de56acb3345ec23ecdb3eb183b3316982138ae54b7d0c4c788
data/CODEOWNERS CHANGED
@@ -1,5 +1,5 @@
1
1
  # default to platform-core
2
- * @puppetlabs/platform-core
2
+ * @puppetlabs/platform-core @puppetlabs/puppetserver-maintainers
3
3
 
4
4
  # Night's Watch
5
5
  /lib/puppet/type/group @puppetlabs/night-s-watch
data/Gemfile CHANGED
@@ -20,7 +20,7 @@ gem "puppet-resource_api", *location_for(ENV['RESOURCE_API_LOCATION'] || ["~> 1.
20
20
 
21
21
  group(:features) do
22
22
  gem 'diff-lcs', '~> 1.3', require: false
23
- gem 'hiera-eyaml', require: false
23
+ gem 'hiera-eyaml', *location_for(ENV['HIERA_EYAML_LOCATION'])
24
24
  gem 'hocon', '~> 1.0', require: false
25
25
  # requires native libshadow headers/libs
26
26
  #gem 'ruby-shadow', '~> 2.5', require: false, platforms: [:ruby]
@@ -40,8 +40,8 @@ group(:test) do
40
40
  gem "rspec", "~> 3.1", require: false
41
41
  gem "rspec-its", "~> 1.1", require: false
42
42
  gem "rspec-collection_matchers", "~> 1.1", require: false
43
- gem 'vcr', '~> 2.9', require: false
44
- gem 'webmock', '~> 1.24', require: false
43
+ gem 'vcr', '~> 5.0', require: false
44
+ gem 'webmock', '~> 3.0', require: false
45
45
  gem 'yard', require: false
46
46
 
47
47
  gem 'rubocop', '~> 0.49', require: false, platforms: [:ruby]
@@ -66,7 +66,7 @@ group(:documentation) do
66
66
  gem 'ronn', '~> 0.7.3', require: false, platforms: [:ruby]
67
67
  end
68
68
 
69
- if File.exists? "#{__FILE__}.local"
69
+ if File.exist? "#{__FILE__}.local"
70
70
  eval(File.read("#{__FILE__}.local"), binding)
71
71
  end
72
72
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puppet (6.4.4)
4
+ puppet (6.4.5)
5
5
  CFPropertyList (~> 2.2)
6
6
  facter (>= 2.4.0, < 4)
7
7
  fast_gettext (~> 1.1.2)
@@ -22,23 +22,25 @@ GEM
22
22
  coderay (1.1.2)
23
23
  crack (0.4.3)
24
24
  safe_yaml (~> 1.0.0)
25
+ csv (3.1.2)
25
26
  diff-lcs (1.3)
27
+ docopt (0.6.1)
26
28
  facter (2.5.6)
27
29
  fast_gettext (1.1.2)
28
30
  gettext (3.2.9)
29
31
  locale (>= 2.0.5)
30
32
  text (>= 1.3.0)
31
- gettext-setup (0.31)
33
+ gettext-setup (0.34)
32
34
  fast_gettext (~> 1.1.0)
33
- gettext (>= 3.0.2)
35
+ gettext (>= 3.0.2, < 3.3.0)
34
36
  locale
35
37
  hashdiff (1.0.0)
36
- hiera (3.5.0)
37
- hiera-eyaml (3.0.0)
38
+ hiera (3.6.0)
39
+ hiera-eyaml (3.1.1)
38
40
  highline (~> 1.6.19)
39
41
  optimist
40
42
  highline (1.6.21)
41
- hocon (1.2.5)
43
+ hocon (1.3.0)
42
44
  hpricot (0.8.6)
43
45
  httpclient (2.8.3)
44
46
  json-schema (2.8.1)
@@ -48,52 +50,56 @@ GEM
48
50
  method_source (0.9.2)
49
51
  minitar (0.9)
50
52
  msgpack (1.3.1)
51
- multi_json (1.13.1)
52
- mustache (1.1.0)
53
+ multi_json (1.14.1)
54
+ mustache (1.1.1)
53
55
  optimist (3.0.0)
54
- packaging (0.99.44)
56
+ packaging (0.99.52)
55
57
  artifactory (~> 2)
56
58
  rake (>= 12.3)
57
- parallel (1.18.0)
58
- parser (2.6.5.0)
59
+ release-metrics
60
+ parallel (1.19.1)
61
+ parser (2.7.0.2)
59
62
  ast (~> 2.4.0)
60
63
  powerpack (0.1.2)
61
64
  pry (0.12.2)
62
65
  coderay (~> 1.1.0)
63
66
  method_source (~> 0.9.0)
64
- public_suffix (4.0.1)
67
+ public_suffix (4.0.3)
65
68
  puppet-resource_api (1.8.7)
66
69
  hocon (>= 1.0)
67
- puppetserver-ca (1.4.0)
70
+ puppetserver-ca (1.5.0)
68
71
  facter (>= 2.0.1, < 4)
69
72
  racc (1.4.9)
70
73
  rainbow (2.2.2)
71
74
  rake
72
75
  rake (12.3.3)
73
76
  rdiscount (2.2.0.1)
74
- rdoc (6.2.0)
77
+ rdoc (6.2.1)
78
+ release-metrics (1.1.0)
79
+ csv
80
+ docopt
75
81
  ronn (0.7.3)
76
82
  hpricot (>= 0.8.2)
77
83
  mustache (>= 0.7.0)
78
84
  rdiscount (>= 1.5.8)
79
- rspec (3.8.0)
80
- rspec-core (~> 3.8.0)
81
- rspec-expectations (~> 3.8.0)
82
- rspec-mocks (~> 3.8.0)
85
+ rspec (3.9.0)
86
+ rspec-core (~> 3.9.0)
87
+ rspec-expectations (~> 3.9.0)
88
+ rspec-mocks (~> 3.9.0)
83
89
  rspec-collection_matchers (1.2.0)
84
90
  rspec-expectations (>= 2.99.0.beta1)
85
- rspec-core (3.8.2)
86
- rspec-support (~> 3.8.0)
87
- rspec-expectations (3.8.6)
91
+ rspec-core (3.9.1)
92
+ rspec-support (~> 3.9.1)
93
+ rspec-expectations (3.9.0)
88
94
  diff-lcs (>= 1.2.0, < 2.0)
89
- rspec-support (~> 3.8.0)
95
+ rspec-support (~> 3.9.0)
90
96
  rspec-its (1.3.0)
91
97
  rspec-core (>= 3.0.0)
92
98
  rspec-expectations (>= 3.0.0)
93
- rspec-mocks (3.8.2)
99
+ rspec-mocks (3.9.1)
94
100
  diff-lcs (>= 1.2.0, < 2.0)
95
- rspec-support (~> 3.8.0)
96
- rspec-support (3.8.3)
101
+ rspec-support (~> 3.9.0)
102
+ rspec-support (3.9.2)
97
103
  rubocop (0.49.1)
98
104
  parallel (~> 1.10)
99
105
  parser (>= 2.3.3.1, < 3.0)
@@ -103,18 +109,18 @@ GEM
103
109
  unicode-display_width (~> 1.0, >= 1.0.1)
104
110
  rubocop-i18n (1.2.0)
105
111
  rubocop (~> 0.49.0)
106
- ruby-prof (1.0.0)
112
+ ruby-prof (1.1.0)
107
113
  ruby-progressbar (1.10.1)
108
114
  safe_yaml (1.0.5)
109
115
  semantic_puppet (1.0.2)
110
116
  text (1.3.1)
111
117
  unicode-display_width (1.6.0)
112
- vcr (2.9.3)
113
- webmock (1.24.6)
118
+ vcr (5.0.0)
119
+ webmock (3.7.6)
114
120
  addressable (>= 2.3.6)
115
121
  crack (>= 0.3.2)
116
- hashdiff
117
- yard (0.9.20)
122
+ hashdiff (>= 0.4.0, < 2.0.0)
123
+ yard (0.9.24)
118
124
 
119
125
  PLATFORMS
120
126
  ruby
@@ -144,8 +150,8 @@ DEPENDENCIES
144
150
  rubocop-i18n (~> 1.2.0)
145
151
  ruby-prof (>= 0.16.0)
146
152
  semantic_puppet (~> 1.0)
147
- vcr (~> 2.9)
148
- webmock (~> 1.24)
153
+ vcr (~> 5.0)
154
+ webmock (~> 3.0)
149
155
  yard
150
156
 
151
157
  BUNDLED WITH
@@ -16,3 +16,4 @@ apt_signing_server: 'apt.puppetlabs.com'
16
16
  apt_repo_url: 'http://apt.puppetlabs.com'
17
17
  apt_repo_path: '/opt/repository/incoming'
18
18
  tar_host: 'downloads.puppetlabs.com'
19
+ nonfinal_gem_path: '/opt/repository-nightlies/downloads/gems/puppet6-nightly'
@@ -75,15 +75,15 @@ class X509Collector
75
75
  end
76
76
  when OpenSSL::X509::Certificate
77
77
  signature_desc = who_signed(meaning, key_names, keys)
78
- "Certificate assigning name #{meaning.subject.to_s} to #{key_names[meaning.public_key.to_s]}\n serial number #{meaning.serial}\n issued by #{meaning.issuer.to_s}\n signed by #{signature_desc}"
78
+ "Certificate assigning name #{meaning.subject} to #{key_names[meaning.public_key.to_s]}\n serial number #{meaning.serial}\n issued by #{meaning.issuer}\n signed by #{signature_desc}"
79
79
  when OpenSSL::X509::Request
80
80
  signature_desc = who_signed(meaning, key_names, keys)
81
- "Certificate request for #{meaning.subject.to_s} having key #{key_names[meaning.public_key.to_s]}\n signed by #{signature_desc}"
81
+ "Certificate request for #{meaning.subject} having key #{key_names[meaning.public_key.to_s]}\n signed by #{signature_desc}"
82
82
  when OpenSSL::X509::CRL
83
83
  signature_desc = who_signed(meaning, key_names, keys)
84
84
  revoked_serial_numbers = meaning.revoked.map { |r| r.serial }
85
85
  revoked_desc = if revoked_serial_numbers.count > 0 then "serial numbers #{revoked_serial_numbers.inspect}" else "nothing" end
86
- "Certificate revocation list revoking #{revoked_desc}\n issued by #{meaning.issuer.to_s}\n signed by #{signature_desc}"
86
+ "Certificate revocation list revoking #{revoked_desc}\n issued by #{meaning.issuer}\n signed by #{signature_desc}"
87
87
  else
88
88
  "Unknown"
89
89
  end
@@ -435,9 +435,9 @@ begin
435
435
  when "--node"
436
436
  $options[:nodes] << arg
437
437
  when "--list"
438
- Suite.suites.sort { |a,b| a.to_s <=> b.to_s }.each do |suite_name|
438
+ Suite.suites.sort_by(&:to_s).each do |suite_name|
439
439
  suite = Suite[suite_name]
440
- tests = suite.tests.sort { |a,b| a.to_s <=> b.to_s }.join(", ")
440
+ tests = suite.tests.sort_by(&:to_s).join(", ")
441
441
  puts "%20s: %s" % [suite_name, tests]
442
442
  end
443
443
  exit(0)
@@ -159,7 +159,7 @@ class ExternalNode
159
159
  log("list of patterns for #{filepath}: #{patternlist}")
160
160
 
161
161
  if matchthis =~ Regexp.union(patternlist)
162
- log("matched #{$~.to_s} in #{matchthis}, returning true")
162
+ log("matched #{$~} in #{matchthis}, returning true")
163
163
  return true
164
164
 
165
165
  else # hostname didn't match anything in patternlist
@@ -181,7 +181,7 @@ class ExternalNode
181
181
  log("Attempting to match [#{@hostname}] in [#{filepath}]")
182
182
  if matched_in_patternfile?(filepath,@hostname)
183
183
  @classes << patternfile.to_s
184
- log("Appended #{patternfile.to_s} to classes instance variable")
184
+ log("Appended #{patternfile} to classes instance variable")
185
185
  end
186
186
  end
187
187
  end
@@ -198,7 +198,7 @@ class ExternalNode
198
198
  log("Attempting to match [#{@hostname}] in [#{filepath}]")
199
199
  if matched_in_patternfile?(filepath,@hostname)
200
200
  @environment = patternfile.to_s
201
- log("Wrote #{patternfile.to_s} to environment instance variable")
201
+ log("Wrote #{patternfile} to environment instance variable")
202
202
  end
203
203
  end
204
204
  end
@@ -230,7 +230,7 @@ class ExternalNode
230
230
  log("Attempting to match [#{@hostname}] in [#{secondlevel}]")
231
231
  if matched_in_patternfile?(secondlevel, @hostname)
232
232
  @parameters[ parametername.to_s ] = patternfile.to_s
233
- log("Set @parameters[#{parametername.to_s}] = #{patternfile.to_s}")
233
+ log("Set @parameters[#{parametername}] = #{patternfile}")
234
234
  end
235
235
  end
236
236
  end
@@ -15,6 +15,7 @@ class WindowsDaemon < Win32::Daemon
15
15
 
16
16
  @run_thread = nil
17
17
  @LOG_TO_FILE = false
18
+ @loglevel = 0
18
19
  LOG_FILE = File.expand_path(File.join(Dir::COMMON_APPDATA, 'PuppetLabs', 'puppet', 'var', 'log', 'windows.log'))
19
20
  LEVELS = [:debug, :info, :notice, :warning, :err, :alert, :emerg, :crit]
20
21
  LEVELS.each do |level|
@@ -37,7 +38,9 @@ class WindowsDaemon < Win32::Daemon
37
38
  FileUtils.mkdir_p(File.dirname(LOG_FILE))
38
39
  args = args.gsub("--logtofile","")
39
40
  end
40
- basedir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
41
+
42
+ base_dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
43
+ load_env(base_dir)
41
44
 
42
45
  # The puppet installer registers a 'Puppet' event source. For the moment events will be logged with this key, but
43
46
  # it may be a good idea to split the Service and Puppet events later so it's easier to read in the windows Event Log.
@@ -54,25 +57,29 @@ class WindowsDaemon < Win32::Daemon
54
57
  # )
55
58
  # end
56
59
 
57
- puppet = File.join(basedir, 'bin', 'puppet.bat')
58
- unless File.exists?(puppet)
60
+ puppet = File.join(base_dir, 'puppet', 'bin', 'puppet')
61
+ ruby = File.join(base_dir, 'puppet', 'bin', 'ruby.exe')
62
+ ruby_puppet_cmd = "\"#{ruby}\" \"#{puppet}\""
63
+
64
+ unless File.exist?(puppet)
59
65
  log_err("File not found: '#{puppet}'")
60
66
  return
61
67
  end
62
68
  log_debug("Using '#{puppet}'")
63
69
 
64
70
  cmdline_debug = argsv.index('--debug') ? :debug : nil
65
- @loglevel = parse_log_level(puppet, cmdline_debug)
71
+ @loglevel = parse_log_level(ruby_puppet_cmd, cmdline_debug)
66
72
  log_notice('Service started')
67
73
 
68
74
  service = self
69
75
  @run_thread = Thread.new do
70
76
  begin
71
77
  while service.running? do
72
- runinterval = service.parse_runinterval(puppet)
78
+ runinterval = service.parse_runinterval(ruby_puppet_cmd)
79
+
73
80
  if service.state == RUNNING or service.state == IDLE
74
81
  service.log_notice("Executing agent with arguments: #{args}")
75
- pid = Process.create(:command_line => "\"#{puppet}\" agent --onetime #{args}", :creation_flags => CREATE_NEW_CONSOLE).process_id
82
+ pid = Process.create(:command_line => "#{ruby_puppet_cmd} agent --onetime #{args}", :creation_flags => CREATE_NEW_CONSOLE).process_id
76
83
  service.log_debug("Process created: #{pid}")
77
84
  else
78
85
  service.log_debug("Service is paused. Not invoking Puppet agent")
@@ -153,7 +160,7 @@ class WindowsDaemon < Win32::Daemon
153
160
 
154
161
  def parse_runinterval(puppet_path)
155
162
  begin
156
- runinterval = %x{ "#{puppet_path}" agent --configprint runinterval }.to_i
163
+ runinterval = %x{ #{puppet_path} agent --configprint runinterval }.to_i
157
164
  if runinterval == 0
158
165
  runinterval = 1800
159
166
  log_err("Failed to determine runinterval, defaulting to #{runinterval} seconds")
@@ -168,7 +175,7 @@ class WindowsDaemon < Win32::Daemon
168
175
 
169
176
  def parse_log_level(puppet_path,cmdline_debug)
170
177
  begin
171
- loglevel = %x{ "#{puppet_path}" agent --configprint log_level}.chomp
178
+ loglevel = %x{ #{puppet_path} agent --configprint log_level}.chomp
172
179
  unless loglevel
173
180
  loglevel = :notice
174
181
  log_err("Failed to determine loglevel, defaulting to #{loglevel}")
@@ -180,6 +187,29 @@ class WindowsDaemon < Win32::Daemon
180
187
 
181
188
  LEVELS.index(cmdline_debug ? cmdline_debug : loglevel.to_sym)
182
189
  end
190
+
191
+ private
192
+
193
+ def load_env(base_dir)
194
+ begin
195
+ # ENV that uses backward slashes
196
+ ENV['FACTER_env_windows_installdir'] = base_dir.tr('/', '\\')
197
+ ENV['PL_BASEDIR'] = base_dir.tr('/', '\\')
198
+ ENV['PUPPET_DIR'] = File.join(base_dir, 'puppet').tr('/', '\\')
199
+ ENV['OPENSSL_CONF'] = File.join(base_dir, 'puppet', 'ssl', 'openssl.cnf').tr('/', '\\')
200
+ ENV['SSL_CERT_DIR'] = File.join(base_dir, 'puppet', 'ssl', 'certs').tr('/', '\\')
201
+ ENV['SSL_CERT_FILE'] = File.join(base_dir, 'puppet', 'ssl', 'cert.pem').tr('/', '\\')
202
+ ENV['Path'] = [
203
+ File.join(base_dir, 'puppet', 'bin'),
204
+ File.join(base_dir, 'bin'),
205
+ ].join(';').tr('/', '\\') + ';' + ENV['Path']
206
+
207
+ # ENV that uses forward slashes
208
+ ENV['RUBYLIB'] = "#{File.join(base_dir, 'puppet','lib')};#{ENV['RUBYLIB']}"
209
+ rescue => e
210
+ log_exception(e)
211
+ end
212
+ end
183
213
  end
184
214
 
185
215
  if __FILE__ == $0
data/install.rb CHANGED
@@ -122,12 +122,12 @@ def check_prereqs
122
122
  facter_version = Facter.version.to_f
123
123
  if facter_version < MIN_FACTER_VERSION
124
124
  puts "Facter version: #{facter_version}; minimum required: #{MIN_FACTER_VERSION}; cannot install"
125
- exit (-1)
125
+ exit(-1)
126
126
  end
127
127
  end
128
128
  rescue LoadError
129
129
  puts "Could not load #{pre}; cannot install"
130
- exit (-1)
130
+ exit(-1)
131
131
  end
132
132
  }
133
133
  end
@@ -248,7 +248,7 @@ def prepare_installation
248
248
  require 'win32/dir'
249
249
  rescue LoadError => e
250
250
  puts "Cannot run on Microsoft Windows without the win32-process, win32-dir & win32-service gems: #{e}"
251
- exit (-1)
251
+ exit(-1)
252
252
  end
253
253
  end
254
254
 
@@ -437,13 +437,13 @@ def install_binfile(from, op_file, target)
437
437
  if $operatingsystem == "windows" && InstallOptions.batch_files
438
438
  installed_wrapper = false
439
439
 
440
- unless File.extname(from).match(/\.(cmd|bat)/)
441
- if File.exists?("#{from}.bat")
440
+ unless File.extname(from) =~ /\.(cmd|bat)/
441
+ if File.exist?("#{from}.bat")
442
442
  FileUtils.install("#{from}.bat", File.join(target, "#{op_file}.bat"), :mode => 0755, :preserve => true, :verbose => true)
443
443
  installed_wrapper = true
444
444
  end
445
445
 
446
- if File.exists?("#{from}.cmd")
446
+ if File.exist?("#{from}.cmd")
447
447
  FileUtils.install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), :mode => 0755, :preserve => true, :verbose => true)
448
448
  installed_wrapper = true
449
449
  end
@@ -183,7 +183,7 @@ class Application
183
183
 
184
184
  # used to declare code that handle an option
185
185
  def option(*options, &block)
186
- long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).gsub('-','_')
186
+ long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).tr('-','_')
187
187
  fname = "handle_#{long}".intern
188
188
  if (block_given?)
189
189
  define_method(fname, &block)
@@ -230,8 +230,8 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
230
230
  catalog =
231
231
  begin
232
232
  Puppet::Resource::Catalog.indirection.find(node.name, :use_node => node)
233
- rescue Puppet::ParseErrorWithIssue, Puppet::Error
234
- # already logged and handled by the compiler for these two cases
233
+ rescue Puppet::Error
234
+ # already logged and handled by the compiler, including Puppet::ParseErrorWithIssue
235
235
  exit(1)
236
236
  end
237
237
 
@@ -64,9 +64,7 @@ class TypeDoc
64
64
 
65
65
  def list_types
66
66
  puts "These are the types known to puppet:\n"
67
- @types.keys.sort { |a, b|
68
- a.to_s <=> b.to_s
69
- }.each do |name|
67
+ @types.keys.sort_by(&:to_s).each do |name|
70
68
  type = @types[name]
71
69
  s = type.doc.gsub(/\s+/, " ")
72
70
  n = s.index(". ")
@@ -149,18 +147,14 @@ class TypeDoc
149
147
  end
150
148
 
151
149
  def format_providers(type)
152
- type.providers.sort { |a,b|
153
- a.to_s <=> b.to_s
154
- }.each { |prov|
150
+ type.providers.sort_by(&:to_s).each { |prov|
155
151
  puts "\n- **#{prov}**"
156
152
  puts @format.wrap(type.provider(prov).doc, :indent => 4, :scrub => true)
157
153
  }
158
154
  end
159
155
 
160
156
  def list_providers(type)
161
- list = type.providers.sort { |a,b|
162
- a.to_s <=> b.to_s
163
- }.join(", ")
157
+ list = type.providers.sort_by(&:to_s).join(", ")
164
158
  puts @format.wrap(list, :indent => 4)
165
159
  end
166
160