bolt 0.23.0 → 0.24.0

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

Potentially problematic release.


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

Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +5 -2
  3. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +5 -1
  4. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +5 -8
  5. data/lib/bolt/applicator.rb +11 -8
  6. data/lib/bolt/boltdir.rb +13 -5
  7. data/lib/bolt/catalog.rb +22 -47
  8. data/lib/bolt/config.rb +1 -26
  9. data/lib/bolt/executor.rb +1 -1
  10. data/lib/bolt/outputter.rb +0 -9
  11. data/lib/bolt/outputter/human.rb +29 -14
  12. data/lib/bolt/outputter/json.rb +12 -1
  13. data/lib/bolt/pal.rb +12 -10
  14. data/lib/bolt/target.rb +0 -6
  15. data/lib/bolt/task.rb +53 -10
  16. data/lib/bolt/transport/base.rb +1 -6
  17. data/lib/bolt/transport/local.rb +11 -13
  18. data/lib/bolt/transport/local/shell.rb +2 -2
  19. data/lib/bolt/transport/ssh.rb +16 -11
  20. data/lib/bolt/transport/winrm.rb +8 -11
  21. data/lib/bolt/version.rb +1 -1
  22. data/lib/bolt_ext/schemas/task.json +12 -5
  23. data/libexec/apply_catalog.rb +3 -1
  24. data/libexec/bolt_catalog +4 -0
  25. data/vendored/puppet/lib/puppet.rb +2 -1
  26. data/vendored/puppet/lib/puppet/application/agent.rb +2 -6
  27. data/vendored/puppet/lib/puppet/application/apply.rb +100 -60
  28. data/vendored/puppet/lib/puppet/application/cert.rb +26 -291
  29. data/vendored/puppet/lib/puppet/application/device.rb +0 -5
  30. data/vendored/puppet/lib/puppet/application/lookup.rb +1 -1
  31. data/vendored/puppet/lib/puppet/application/ssl.rb +133 -0
  32. data/vendored/puppet/lib/puppet/application_support.rb +1 -2
  33. data/vendored/puppet/lib/puppet/configurer.rb +34 -50
  34. data/vendored/puppet/lib/puppet/configurer/downloader.rb +1 -1
  35. data/vendored/puppet/lib/puppet/configurer/plugin_handler.rb +1 -1
  36. data/vendored/puppet/lib/puppet/daemon.rb +1 -1
  37. data/vendored/puppet/lib/puppet/defaults.rb +40 -117
  38. data/vendored/puppet/lib/puppet/face/epp.rb +2 -2
  39. data/vendored/puppet/lib/puppet/face/help.rb +21 -7
  40. data/vendored/puppet/lib/puppet/face/node/clean.rb +14 -10
  41. data/vendored/puppet/lib/puppet/feature/base.rb +7 -23
  42. data/vendored/puppet/lib/puppet/feature/eventlog.rb +1 -1
  43. data/vendored/puppet/lib/puppet/file_serving/base.rb +2 -2
  44. data/vendored/puppet/lib/puppet/file_serving/fileset.rb +1 -1
  45. data/vendored/puppet/lib/puppet/file_serving/metadata.rb +2 -2
  46. data/vendored/puppet/lib/puppet/functions.rb +133 -0
  47. data/vendored/puppet/lib/puppet/functions/eyaml_lookup_key.rb +4 -5
  48. data/vendored/puppet/lib/puppet/functions/filter.rb +7 -6
  49. data/vendored/puppet/lib/puppet/functions/new.rb +37 -53
  50. data/vendored/puppet/lib/puppet/functions/warning.rb +1 -1
  51. data/vendored/puppet/lib/puppet/functions/yaml_data.rb +4 -5
  52. data/vendored/puppet/lib/puppet/gettext/config.rb +1 -1
  53. data/vendored/puppet/lib/puppet/graph.rb +0 -2
  54. data/vendored/puppet/lib/puppet/indirector/catalog/json.rb +14 -3
  55. data/vendored/puppet/lib/puppet/indirector/catalog/yaml.rb +0 -16
  56. data/vendored/puppet/lib/puppet/indirector/certificate/file.rb +0 -1
  57. data/vendored/puppet/lib/puppet/indirector/facts/yaml.rb +4 -2
  58. data/vendored/puppet/lib/puppet/indirector/key/file.rb +1 -6
  59. data/vendored/puppet/lib/puppet/indirector/node/exec.rb +1 -3
  60. data/vendored/puppet/lib/puppet/indirector/node/yaml.rb +0 -6
  61. data/vendored/puppet/lib/puppet/indirector/request.rb +1 -1
  62. data/vendored/puppet/lib/puppet/indirector/ssl_file.rb +3 -44
  63. data/vendored/puppet/lib/puppet/indirector/yaml.rb +4 -4
  64. data/vendored/puppet/lib/puppet/info_service/task_information_service.rb +7 -3
  65. data/vendored/puppet/lib/puppet/loaders.rb +1 -0
  66. data/vendored/puppet/lib/puppet/module/task.rb +198 -29
  67. data/vendored/puppet/lib/puppet/module_tool/applications/unpacker.rb +1 -1
  68. data/vendored/puppet/lib/puppet/network/format_support.rb +13 -8
  69. data/vendored/puppet/lib/puppet/network/formats.rb +93 -2
  70. data/vendored/puppet/lib/puppet/network/http/api/indirected_routes.rb +10 -3
  71. data/vendored/puppet/lib/puppet/node/facts.rb +11 -1
  72. data/vendored/puppet/lib/puppet/parser/catalog_compiler.rb +56 -0
  73. data/vendored/puppet/lib/puppet/parser/compiler.rb +3 -1
  74. data/vendored/puppet/lib/puppet/parser/functions.rb +3 -1
  75. data/vendored/puppet/lib/puppet/parser/functions/filter.rb +1 -1
  76. data/vendored/puppet/lib/puppet/parser/functions/generate.rb +1 -1
  77. data/vendored/puppet/lib/puppet/parser/functions/sprintf.rb +12 -1
  78. data/vendored/puppet/lib/puppet/parser/functions/tagged.rb +1 -4
  79. data/vendored/puppet/lib/puppet/parser/scope.rb +1 -1
  80. data/vendored/puppet/lib/puppet/parser/script_compiler.rb +7 -2
  81. data/vendored/puppet/lib/puppet/pops/evaluator/deferred_resolver.rb +5 -3
  82. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_converter.rb +23 -4
  83. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +3 -4
  84. data/vendored/puppet/lib/puppet/pops/functions/dispatch.rb +4 -0
  85. data/vendored/puppet/lib/puppet/pops/issues.rb +8 -0
  86. data/vendored/puppet/lib/puppet/pops/loader/loader.rb +2 -2
  87. data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +3 -1
  88. data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +30 -9
  89. data/vendored/puppet/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +62 -0
  90. data/vendored/puppet/lib/puppet/pops/loader/static_loader.rb +0 -1
  91. data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +13 -70
  92. data/vendored/puppet/lib/puppet/pops/loaders.rb +19 -29
  93. data/vendored/puppet/lib/puppet/pops/lookup/hiera_config.rb +1 -1
  94. data/vendored/puppet/lib/puppet/pops/model/model_label_provider.rb +4 -1
  95. data/vendored/puppet/lib/puppet/pops/pcore.rb +10 -33
  96. data/vendored/puppet/lib/puppet/pops/serialization.rb +2 -0
  97. data/vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb +2 -1
  98. data/vendored/puppet/lib/puppet/pops/serialization/to_data_converter.rb +11 -3
  99. data/vendored/puppet/lib/puppet/pops/serialization/to_stringified_converter.rb +226 -0
  100. data/vendored/puppet/lib/puppet/pops/types/p_object_type.rb +3 -0
  101. data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +97 -47
  102. data/vendored/puppet/lib/puppet/pops/validation/validator_factory_4_0.rb +7 -8
  103. data/vendored/puppet/lib/puppet/property/keyvalue.rb +70 -8
  104. data/vendored/puppet/lib/puppet/provider/aix_object.rb +483 -0
  105. data/vendored/puppet/lib/puppet/provider/file/windows.rb +1 -1
  106. data/vendored/puppet/lib/puppet/provider/group/aix.rb +51 -112
  107. data/vendored/puppet/lib/puppet/provider/package/gem.rb +1 -1
  108. data/vendored/puppet/lib/puppet/provider/package/pip.rb +1 -1
  109. data/vendored/puppet/lib/puppet/provider/package/puppet_gem.rb +1 -1
  110. data/vendored/puppet/lib/puppet/provider/package/rpm.rb +1 -1
  111. data/vendored/puppet/lib/puppet/provider/package/windows/package.rb +1 -1
  112. data/vendored/puppet/lib/puppet/provider/package/zypper.rb +1 -1
  113. data/vendored/puppet/lib/puppet/provider/service/systemd.rb +1 -1
  114. data/vendored/puppet/lib/puppet/provider/service/windows.rb +37 -40
  115. data/vendored/puppet/lib/puppet/provider/user/aix.rb +142 -254
  116. data/vendored/puppet/lib/puppet/resource.rb +20 -3
  117. data/vendored/puppet/lib/puppet/resource/catalog.rb +2 -12
  118. data/vendored/puppet/lib/puppet/rest/routes.rb +97 -34
  119. data/vendored/puppet/lib/puppet/settings.rb +1 -1
  120. data/vendored/puppet/lib/puppet/settings/file_setting.rb +1 -1
  121. data/vendored/puppet/lib/puppet/ssl/base.rb +1 -9
  122. data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +1 -13
  123. data/vendored/puppet/lib/puppet/ssl/certificate_request_attributes.rb +1 -1
  124. data/vendored/puppet/lib/puppet/ssl/host.rb +114 -232
  125. data/vendored/puppet/lib/puppet/ssl/key.rb +1 -5
  126. data/vendored/puppet/lib/puppet/ssl/oids.rb +1 -1
  127. data/vendored/puppet/lib/puppet/test/test_helper.rb +0 -4
  128. data/vendored/puppet/lib/puppet/transaction/event.rb +3 -7
  129. data/vendored/puppet/lib/puppet/transaction/persistence.rb +1 -1
  130. data/vendored/puppet/lib/puppet/type/exec.rb +18 -16
  131. data/vendored/puppet/lib/puppet/type/file.rb +3 -3
  132. data/vendored/puppet/lib/puppet/type/file/source.rb +20 -7
  133. data/vendored/puppet/lib/puppet/type/group.rb +3 -5
  134. data/vendored/puppet/lib/puppet/type/notify.rb +1 -1
  135. data/vendored/puppet/lib/puppet/type/package.rb +2 -5
  136. data/vendored/puppet/lib/puppet/type/schedule.rb +1 -1
  137. data/vendored/puppet/lib/puppet/type/service.rb +3 -6
  138. data/vendored/puppet/lib/puppet/type/tidy.rb +1 -1
  139. data/vendored/puppet/lib/puppet/type/user.rb +13 -20
  140. data/vendored/puppet/lib/puppet/util.rb +8 -9
  141. data/vendored/puppet/lib/puppet/util/execution.rb +3 -3
  142. data/vendored/puppet/lib/puppet/util/feature.rb +61 -39
  143. data/vendored/puppet/lib/puppet/util/log/destinations.rb +1 -1
  144. data/vendored/puppet/lib/puppet/util/rdoc.rb +1 -1
  145. data/vendored/puppet/lib/puppet/util/run_mode.rb +1 -1
  146. data/vendored/puppet/lib/puppet/util/storage.rb +1 -1
  147. data/vendored/puppet/lib/puppet/util/suidmanager.rb +7 -5
  148. data/vendored/puppet/lib/puppet/util/tag_set.rb +1 -1
  149. data/vendored/puppet/lib/puppet/util/tagging.rb +1 -1
  150. data/vendored/puppet/lib/puppet/util/windows.rb +18 -2
  151. data/vendored/puppet/lib/puppet/util/windows/adsi.rb +154 -205
  152. data/vendored/puppet/lib/puppet/util/windows/service.rb +770 -0
  153. data/vendored/puppet/lib/puppet/util/yaml.rb +41 -5
  154. data/vendored/puppet/lib/puppet/version.rb +1 -1
  155. data/vendored/puppet/lib/puppet_pal.rb +280 -24
  156. metadata +8 -38
  157. data/lib/bolt/catalog/compiler.rb +0 -48
  158. data/lib/bolt/catalog/loaders.rb +0 -19
  159. data/vendored/puppet/lib/puppet/application/ca.rb +0 -11
  160. data/vendored/puppet/lib/puppet/application/certificate.rb +0 -17
  161. data/vendored/puppet/lib/puppet/application/certificate_request.rb +0 -7
  162. data/vendored/puppet/lib/puppet/application/certificate_revocation_list.rb +0 -7
  163. data/vendored/puppet/lib/puppet/face/ca.rb +0 -266
  164. data/vendored/puppet/lib/puppet/face/certificate.rb +0 -167
  165. data/vendored/puppet/lib/puppet/face/certificate_request.rb +0 -56
  166. data/vendored/puppet/lib/puppet/face/certificate_revocation_list.rb +0 -56
  167. data/vendored/puppet/lib/puppet/graph/random_prioritizer.rb +0 -16
  168. data/vendored/puppet/lib/puppet/graph/title_hash_prioritizer.rb +0 -16
  169. data/vendored/puppet/lib/puppet/indirector/certificate/ca.rb +0 -9
  170. data/vendored/puppet/lib/puppet/indirector/certificate/disabled_ca.rb +0 -22
  171. data/vendored/puppet/lib/puppet/indirector/certificate_request/ca.rb +0 -22
  172. data/vendored/puppet/lib/puppet/indirector/certificate_request/disabled_ca.rb +0 -22
  173. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/ca.rb +0 -8
  174. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +0 -22
  175. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/file.rb +0 -8
  176. data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/rest.rb +0 -11
  177. data/vendored/puppet/lib/puppet/indirector/certificate_status.rb +0 -4
  178. data/vendored/puppet/lib/puppet/indirector/certificate_status/file.rb +0 -91
  179. data/vendored/puppet/lib/puppet/indirector/certificate_status/rest.rb +0 -11
  180. data/vendored/puppet/lib/puppet/indirector/key/ca.rb +0 -16
  181. data/vendored/puppet/lib/puppet/indirector/key/disabled_ca.rb +0 -22
  182. data/vendored/puppet/lib/puppet/indirector/ldap.rb +0 -86
  183. data/vendored/puppet/lib/puppet/indirector/node/ldap.rb +0 -275
  184. data/vendored/puppet/lib/puppet/provider/aixobject.rb +0 -392
  185. data/vendored/puppet/lib/puppet/provider/cron/crontab.rb +0 -297
  186. data/vendored/puppet/lib/puppet/ssl/certificate_authority.rb +0 -475
  187. data/vendored/puppet/lib/puppet/ssl/certificate_authority/autosign_command.rb +0 -45
  188. data/vendored/puppet/lib/puppet/ssl/certificate_authority/interface.rb +0 -324
  189. data/vendored/puppet/lib/puppet/ssl/certificate_factory.rb +0 -219
  190. data/vendored/puppet/lib/puppet/ssl/certificate_revocation_list.rb +0 -111
  191. data/vendored/puppet/lib/puppet/ssl/inventory.rb +0 -55
  192. data/vendored/puppet/lib/puppet/type/cron.rb +0 -480
@@ -51,16 +51,14 @@
51
51
  # The following sections show the arguments and conversion rules
52
52
  # per data type built into the Puppet Type System.
53
53
  #
54
- # Conversion to Optional[T] and NotUndef[T]
55
- # -----------------------------------------
54
+ # ### Conversion to Optional[T] and NotUndef[T]
56
55
  #
57
56
  # Conversion to these data types is the same as a conversion to the type argument `T`.
58
57
  # In the case of `Optional[T]` it is accepted that the argument to convert may be `undef`.
59
58
  # It is however not acceptable to give other arguments (than `undef`) that cannot be
60
59
  # converted to `T`.
61
60
  #
62
- # Conversion to Integer
63
- # ---------------------
61
+ # ### Conversion to Integer
64
62
  #
65
63
  # A new `Integer` can be created from `Integer`, `Float`, `Boolean`, and `String` values.
66
64
  # For conversion from `String` it is possible to specify the radix (base).
@@ -108,8 +106,7 @@
108
106
  # $a_number = Integer(-38, 10, true) # results in 38
109
107
  # ```
110
108
  #
111
- # Conversion to Float
112
- # -------------------
109
+ # ### Conversion to Float
113
110
  #
114
111
  # A new `Float` can be created from `Integer`, `Float`, `Boolean`, and `String` values.
115
112
  # For conversion from `String` both float and integer formats are supported.
@@ -121,15 +118,13 @@
121
118
  # )
122
119
  # ```
123
120
  #
124
- #
125
121
  # * For an integer, the floating point fraction of `.0` is added to the value.
126
122
  # * A `Boolean` `true` is converted to 1.0, and a `false` to 0.0
127
123
  # * In `String` format, integer prefixes for hex and binary are understood (but not octal since
128
124
  # floating point in string format may start with a '0').
129
125
  # * When `abs` is set to `true`, the result will be an absolute floating point value.
130
126
  #
131
- # Conversion to Numeric
132
- # ---------------------
127
+ # ### Conversion to Numeric
133
128
  #
134
129
  # A new `Integer` or `Float` can be created from `Integer`, `Float`, `Boolean` and
135
130
  # `String` values.
@@ -158,12 +153,11 @@
158
153
  # $a_number = Numeric(-42, true) # results in 42
159
154
  # ```
160
155
  #
161
- # Conversion to Timespan
162
- # -------------------
156
+ # ### Conversion to Timespan
163
157
  #
164
158
  # A new `Timespan` can be created from `Integer`, `Float`, `String`, and `Hash` values. Several variants of the constructor are provided.
165
159
  #
166
- # #### Timespan from seconds
160
+ # **Timespan from seconds**
167
161
  #
168
162
  # When a Float is used, the decimal part represents fractions of a second.
169
163
  #
@@ -173,7 +167,7 @@
173
167
  # )
174
168
  # ```
175
169
  #
176
- # #### Timespan from days, hours, minutes, seconds, and fractions of a second
170
+ # **Timespan from days, hours, minutes, seconds, and fractions of a second**
177
171
  #
178
172
  # The arguments can be passed separately in which case the first four, days, hours, minutes, and seconds are mandatory and the rest are optional.
179
173
  # All values may overflow and/or be negative. The internal 128-bit nano-second integer is calculated as:
@@ -206,7 +200,7 @@
206
200
  # )
207
201
  # ```
208
202
  #
209
- # #### Timespan from String and format directive patterns
203
+ # **Timespan from String and format directive patterns**
210
204
  #
211
205
  # The first argument is parsed using the format optionally passed as a string or array of strings. When an array is used, an attempt
212
206
  # will be made to parse the string using the first entry and then with each entry in succession until parsing succeeds. If the second
@@ -276,12 +270,11 @@
276
270
  # $duration = Timespan('10:03.5', '%M:%S.%N') # 10 minutes, 3 seconds, and 5 nano-seconds
277
271
  # ```
278
272
  #
279
- # Conversion to Timestamp
280
- # -------------------
273
+ # ### Conversion to Timestamp
281
274
  #
282
275
  # A new `Timestamp` can be created from `Integer`, `Float`, `String`, and `Hash` values. Several variants of the constructor are provided.
283
276
  #
284
- # #### Timestamp from seconds since epoch (1970-01-01 00:00:00 UTC)
277
+ # **Timestamp from seconds since epoch (1970-01-01 00:00:00 UTC)**
285
278
  #
286
279
  # When a Float is used, the decimal part represents fractions of a second.
287
280
  #
@@ -291,7 +284,7 @@
291
284
  # )
292
285
  # ```
293
286
  #
294
- # #### Timestamp from String and patterns consisting of format directives
287
+ # **Timestamp from String and patterns consisting of format directives**
295
288
  #
296
289
  # The first argument is parsed using the format optionally passed as a string or array of strings. When an array is used, an attempt
297
290
  # will be made to parse the string using the first entry and then with each entry in succession until parsing succeeds. If the second
@@ -470,9 +463,9 @@
470
463
  #
471
464
  # ```
472
465
  #
473
- # Conversion to Type
474
- # ------------------
475
- # A new `Type` can be create from its `String` representation.
466
+ # ### Conversion to Type
467
+ #
468
+ # A new `Type` can be created from its `String` representation.
476
469
  #
477
470
  # @example Creating a type from a string
478
471
  #
@@ -480,8 +473,7 @@
480
473
  # $t = Type.new('Integer[10]')
481
474
  # ```
482
475
  #
483
- # Conversion to String
484
- # --------------------
476
+ # ### Conversion to String
485
477
  #
486
478
  # Conversion to `String` is the most comprehensive conversion as there are many
487
479
  # use cases where a string representation is wanted. The defaults for the many options
@@ -524,7 +516,7 @@
524
516
  # Note that all data type supports the formats `s` and `p` with the meaning "default string representation" and
525
517
  # "default programmatic string representation" (which for example means that a String is quoted in 'p' format).
526
518
  #
527
- # ### Signatures of String conversion
519
+ # **Signatures of String conversion**
528
520
  #
529
521
  # ```puppet
530
522
  # type Format = Pattern[/^%([\s\+\-#0\[\{<\(\|]*)([1-9][0-9]*)?(?:\.([0-9]+))?([a-zA-Z])/]
@@ -582,7 +574,7 @@
582
574
  # The given formats are merged with the default formats, and matching of values to convert against format is based on
583
575
  # the specificity of the mapped type; for example, different formats can be used for short and long arrays.
584
576
  #
585
- # ### Integer to String
577
+ # **Integer to String**
586
578
  #
587
579
  # | Format | Integer Formats
588
580
  # | ------ | ---------------
@@ -597,7 +589,7 @@
597
589
  #
598
590
  # Defaults to `d`.
599
591
  #
600
- # ### Float to String
592
+ # **Float to String**
601
593
  #
602
594
  # | Format | Float formats
603
595
  # | ------ | -------------
@@ -611,7 +603,7 @@
611
603
  #
612
604
  # Defaults to `p`.
613
605
  #
614
- # ### String to String
606
+ # **String to String**
615
607
  #
616
608
  # | Format | String
617
609
  # | ------ | ------
@@ -625,7 +617,7 @@
625
617
  #
626
618
  # Defaults to `s` at top level and `p` inside array or hash.
627
619
  #
628
- # ### Boolean to String
620
+ # **Boolean to String**
629
621
  #
630
622
  # | Format | Boolean Formats
631
623
  # | ---- | -------------------
@@ -636,14 +628,14 @@
636
628
  # | s | String 'true' / 'false'.
637
629
  # | p | String 'true' / 'false'.
638
630
  #
639
- # ### Regexp to String
631
+ # **Regexp to String**
640
632
  #
641
633
  # | Format | Regexp Formats
642
634
  # | ---- | --------------
643
635
  # | s | No delimiters, quoted if alternative flag `#` is used.
644
636
  # | p | Delimiters `/ /`.
645
637
  #
646
- # ### Undef to String
638
+ # **Undef to String**
647
639
  #
648
640
  # | Format | Undef formats
649
641
  # | ------ | -------------
@@ -656,7 +648,7 @@
656
648
  # | V | String 'N/A'.
657
649
  # | u | String 'undef', or 'undefined' if alternative `#` flag is used.
658
650
  #
659
- # ### Default value to String
651
+ # **Default value to String**
660
652
  #
661
653
  # | Format | Default formats
662
654
  # | ------ | ---------------
@@ -664,7 +656,7 @@
664
656
  # | s | Same as d.
665
657
  # | p | Same as d.
666
658
  #
667
- # ### Binary value to String
659
+ # **Binary value to String**
668
660
  #
669
661
  # | Format | Default formats
670
662
  # | ------ | ---------------
@@ -681,7 +673,7 @@
681
673
  # as hex escaped characters on the form `\\xHH` where `H` is a hex digit.
682
674
  # * The width and precision values are applied to the text part only in `%p` format.
683
675
  #
684
- # ### Array & Tuple to String
676
+ # **Array & Tuple to String**
685
677
  #
686
678
  # | Format | Array/Tuple Formats
687
679
  # | ------ | -------------
@@ -696,7 +688,7 @@
696
688
  # it is taken as the maximum allowed length of a sequence of elements (not including delimiters). If this max length
697
689
  # is exceeded, each element will be indented.
698
690
  #
699
- # ### Hash & Struct to String
691
+ # **Hash & Struct to String**
700
692
  #
701
693
  # | Format | Hash/Struct Formats
702
694
  # | ------ | -------------
@@ -710,14 +702,14 @@
710
702
  #
711
703
  # The alternate form flag `#` will format each hash key/value entry indented on a separate line.
712
704
  #
713
- # ### Type to String
705
+ # **Type to String**
714
706
  #
715
707
  # | Format | Array/Tuple Formats
716
708
  # | ------ | -------------
717
709
  # | s | The same as `p`, quoted if alternative flag `#` is used.
718
710
  # | p | Outputs the type in string form as specified by the Puppet Language.
719
711
  #
720
- # ### Flags
712
+ # **Flags**
721
713
  #
722
714
  # | Flag | Effect
723
715
  # | ------ | ------
@@ -728,8 +720,7 @@
728
720
  # | 0 | Pad with 0 instead of space for widths larger than value.
729
721
  # | <[({\| | Defines an enclosing pair <> [] () {} or \| \| when used with a container type.
730
722
  #
731
- # Conversion to Boolean
732
- # ---
723
+ # ### Conversion to Boolean
733
724
  #
734
725
  # Accepts a single value as argument:
735
726
  #
@@ -740,8 +731,7 @@
740
731
  # * `false` if 'false', 'no', 'n' (case independent compare)
741
732
  # * Boolean is already boolean and is simply returned
742
733
  #
743
- # Conversion to Array and Tuple
744
- # ---
734
+ # ### Conversion to Array and Tuple
745
735
  #
746
736
  # When given a single value as argument:
747
737
  #
@@ -751,7 +741,6 @@
751
741
  # * An `Iterable[T]` is turned into an array of `T` instances.
752
742
  # * A `Binary` is converted to an `Array[Integer[0,255]]` of byte values
753
743
  #
754
- #
755
744
  # When given a second Boolean argument:
756
745
  #
757
746
  # * if `true`, a value that is not already an array is returned as a one element array.
@@ -766,8 +755,7 @@
766
755
  # Conversion to a `Tuple` works exactly as conversion to an `Array`, only that the constructed array is
767
756
  # asserted against the given tuple type.
768
757
  #
769
- # Conversion to Hash and Struct
770
- # ---
758
+ # ### Conversion to Hash and Struct
771
759
  #
772
760
  # Accepts a single value as argument:
773
761
  #
@@ -806,8 +794,8 @@
806
794
  # Conversion to a `Struct` works exactly as conversion to a `Hash`, only that the constructed hash is
807
795
  # asserted against the given struct type.
808
796
  #
809
- # Conversion to a Regexp
810
- # ---
797
+ # ### Conversion to a Regexp
798
+ #
811
799
  # A `String` can be converted into a `Regexp`
812
800
  #
813
801
  # **Example**: Converting a String into a Regexp
@@ -819,8 +807,7 @@
819
807
  # }
820
808
  # ```
821
809
  #
822
- # Creating a SemVer
823
- # ---
810
+ # ### Creating a SemVer
824
811
  #
825
812
  # A SemVer object represents a single [Semantic Version](http://semver.org/).
826
813
  # It can be created from a String, individual values for its parts, or a hash specifying the value per part.
@@ -869,8 +856,7 @@
869
856
  # notice(SemVer('3.4.5') =~ $t) # true
870
857
  # ```
871
858
  #
872
- # Creating a SemVerRange
873
- # ---
859
+ # ### Creating a SemVerRange
874
860
  #
875
861
  # A `SemVerRange` object represents a range of `SemVer`. It can be created from
876
862
  # a `String`, or from two `SemVer` instances, where either end can be given as
@@ -906,8 +892,7 @@
906
892
  #
907
893
  # For examples of `SemVerRange` use see "Creating a SemVer"
908
894
  #
909
- # Creating a Binary
910
- # ---
895
+ # ### Creating a Binary
911
896
  #
912
897
  # A `Binary` object represents a sequence of bytes and it can be created from a String in Base64 format,
913
898
  # an Array containing byte values. A Binary can also be created from a Hash containing the value to convert to
@@ -963,8 +948,7 @@
963
948
  # * Since 4.5.0
964
949
  # * Binary type since 4.8.0
965
950
  #
966
- # Creating an instance of a `Type` using the `Init` type.
967
- # -------
951
+ # ### Creating an instance of a `Type` using the `Init` type
968
952
  #
969
953
  # The type `Init[T]` describes a value that can be used when instantiating a type. When used as the first argument in a call to `new`, it
970
954
  # will dispatch the call to its contained type and optionally augment the parameter list with additional arguments.
@@ -1,4 +1,4 @@
1
- # Logs a message on the server at level `notice`.
1
+ # Logs a message on the server at level `warning`.
2
2
  Puppet::Functions.create_function(:warning, Puppet::Functions::InternalFunction) do
3
3
  # @param values The values to log.
4
4
  # @return [Undef]
@@ -21,7 +21,7 @@ Puppet::Functions.create_function(:yaml_data) do
21
21
  path = options['path']
22
22
  context.cached_file_data(path) do |content|
23
23
  begin
24
- data = YAML.load(content, path)
24
+ data = Puppet::Util::Yaml.safe_load(content, [Symbol], path)
25
25
  if data.is_a?(Hash)
26
26
  Puppet::Pops::Lookup::HieraConfig.symkeys_to_string(data)
27
27
  else
@@ -30,10 +30,9 @@ Puppet::Functions.create_function(:yaml_data) do
30
30
  Puppet.warning(msg)
31
31
  {}
32
32
  end
33
- rescue YAML::SyntaxError => ex
34
- # Psych errors includes the absolute path to the file, so no need to add that
35
- # to the message
36
- raise Puppet::DataBinding::LookupError, "Unable to parse #{ex.message}"
33
+ rescue Puppet::Util::Yaml::YamlLoadError => ex
34
+ # YamlLoadErrors include the absolute path to the file, so no need to add that
35
+ raise Puppet::DataBinding::LookupError, _("Unable to parse %{message}") % { message: ex.message }
37
36
  end
38
37
  end
39
38
  end
@@ -4,7 +4,7 @@ require 'puppet/file_system'
4
4
  module Puppet::GettextConfig
5
5
  LOCAL_PATH = File.absolute_path('../../../locales', File.dirname(__FILE__))
6
6
  POSIX_PATH = File.absolute_path('../../../../../share/locale', File.dirname(__FILE__))
7
- WINDOWS_PATH = File.absolute_path('../../../../../../../puppet/share/locale', File.dirname(__FILE__))
7
+ WINDOWS_PATH = File.absolute_path('../../../../../../puppet/share/locale', File.dirname(__FILE__))
8
8
 
9
9
  # This is the only domain name that won't be a symbol, making it unique from environments.
10
10
  DEFAULT_TEXT_DOMAIN = 'default-text-domain'
@@ -1,8 +1,6 @@
1
1
  module Puppet::Graph
2
2
  require 'puppet/graph/prioritizer'
3
3
  require 'puppet/graph/sequential_prioritizer'
4
- require 'puppet/graph/title_hash_prioritizer'
5
- require 'puppet/graph/random_prioritizer'
6
4
 
7
5
  require 'puppet/graph/simple_graph'
8
6
  require 'puppet/graph/rb_tree_map'
@@ -8,7 +8,7 @@ class Puppet::Resource::Catalog::Json < Puppet::Indirector::JSON
8
8
  utf8 = text.force_encoding(Encoding::UTF_8)
9
9
 
10
10
  if utf8.valid_encoding?
11
- model.convert_from('json', utf8)
11
+ model.convert_from(json_format, utf8)
12
12
  else
13
13
  Puppet.info(_("Unable to deserialize catalog from json, retrying with pson"))
14
14
  model.convert_from('pson', text.force_encoding(Encoding::BINARY))
@@ -16,9 +16,20 @@ class Puppet::Resource::Catalog::Json < Puppet::Indirector::JSON
16
16
  end
17
17
 
18
18
  def to_json(object)
19
- object.render('json')
20
- rescue Puppet::Network::FormatHandler::FormatError
19
+ object.render(json_format)
20
+ rescue Puppet::Network::FormatHandler::FormatError => err
21
21
  Puppet.info(_("Unable to serialize catalog to json, retrying with pson"))
22
+ Puppet.log_exception(err, err.message, level: :debug)
22
23
  object.render('pson').force_encoding(Encoding::BINARY)
23
24
  end
25
+
26
+ private
27
+
28
+ def json_format
29
+ if Puppet[:rich_data]
30
+ 'rich_data_json'
31
+ else
32
+ 'json'
33
+ end
34
+ end
24
35
  end
@@ -3,20 +3,4 @@ require 'puppet/indirector/yaml'
3
3
 
4
4
  class Puppet::Resource::Catalog::Yaml < Puppet::Indirector::Yaml
5
5
  desc "Store catalogs as flat files, serialized using YAML."
6
-
7
- private
8
-
9
- # Override these, because yaml doesn't want to convert our self-referential
10
- # objects. This is hackish, but eh.
11
- def from_yaml(text)
12
- if config = YAML.load(text)
13
- return config
14
- end
15
- end
16
-
17
- def to_yaml(config)
18
- # We can't yaml-dump classes.
19
- #config.edgelist_class = nil
20
- YAML.dump(config)
21
- end
22
6
  end
@@ -5,5 +5,4 @@ class Puppet::SSL::Certificate::File < Puppet::Indirector::SslFile
5
5
  desc "Manage SSL certificates on disk."
6
6
 
7
7
  store_in :certdir
8
- store_ca_at :localcacert
9
8
  end
@@ -8,8 +8,10 @@ class Puppet::Node::Facts::Yaml < Puppet::Indirector::Yaml
8
8
  def search(request)
9
9
  node_names = []
10
10
  Dir.glob(yaml_dir_path).each do |file|
11
- facts = YAML.load_file(file)
12
- node_names << facts.name if node_matches?(facts, request.options)
11
+ facts = load_file(file)
12
+ if facts && node_matches?(facts, request.options)
13
+ node_names << facts.name
14
+ end
13
15
  end
14
16
  node_names
15
17
  end
@@ -5,7 +5,6 @@ class Puppet::SSL::Key::File < Puppet::Indirector::SslFile
5
5
  desc "Manage SSL private and public keys on disk."
6
6
 
7
7
  store_in :privatekeydir
8
- store_ca_at :cakey
9
8
 
10
9
  def allow_remote_requests?
11
10
  false
@@ -13,11 +12,7 @@ class Puppet::SSL::Key::File < Puppet::Indirector::SslFile
13
12
 
14
13
  # Where should we store the public key?
15
14
  def public_key_path(name)
16
- if ca?(name)
17
- Puppet[:capub]
18
- else
19
- File.join(Puppet[:publickeydir], name.to_s + ".pem")
20
- end
15
+ File.join(Puppet[:publickeydir], name.to_s + ".pem")
21
16
  end
22
17
 
23
18
  # Remove the public key, in addition to the private key