puppet-resource_api 1.9.0 → 2.0.0
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/CHANGELOG.md +64 -44
- data/lib/puppet/resource_api/base_context.rb +11 -7
- data/lib/puppet/resource_api/data_type_handling.rb +15 -19
- data/lib/puppet/resource_api/glue.rb +4 -7
- data/lib/puppet/resource_api/parameter.rb +2 -2
- data/lib/puppet/resource_api/property.rb +9 -14
- data/lib/puppet/resource_api/provider_get_cache.rb +41 -0
- data/lib/puppet/resource_api/puppet_context.rb +1 -0
- data/lib/puppet/resource_api/simple_provider.rb +19 -19
- data/lib/puppet/resource_api/transport/wrapper.rb +5 -3
- data/lib/puppet/resource_api/transport.rb +24 -31
- data/lib/puppet/resource_api/type_definition.rb +38 -45
- data/lib/puppet/resource_api/value_creator.rb +4 -6
- data/lib/puppet/resource_api/version.rb +1 -1
- data/lib/puppet/resource_api.rb +120 -91
- data/lib/puppet/util/network_device/simple/device.rb +2 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a48e0eaa8e29f85ccff8b789e7975f868168fba24d1b06947886129ab395900
|
4
|
+
data.tar.gz: f65bcaf44dc9daff85b7c0d5d8f9c54382f4553b393ea49d9cca45ca451c0fa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c029faae370d209d286b91468cf96dd879697d0e48836f3ea8088df79315aae65f9d91a59ff28303b86af0cf4bd49c7d119be5d27fdf5b5238ccdfcb88e7936e
|
7
|
+
data.tar.gz: 74df2d8e1b9e03f3d8860554bbacfc0826f627a65575a73b7927b438072d0e506624552dd2bea6ed214570cf89cfc9ffc98898ddb9fb353e7272075963a6e50c
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,29 @@
|
|
1
|
+
<!-- markdownlint-disable MD024 -->
|
1
2
|
# Changelog
|
2
3
|
|
3
|
-
All
|
4
|
+
All notable changes to this project will be documented in this file.
|
4
5
|
|
6
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
|
5
7
|
|
6
|
-
## [
|
8
|
+
## [v2.0.0](https://github.com/puppetlabs/puppet-resource_api/tree/v2.0.0) - 2025-03-13
|
9
|
+
|
10
|
+
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.9.0...v2.0.0)
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- (CAT-2254) Remove puppet 7 / Ruby 2.7 related code [#368](https://github.com/puppetlabs/puppet-resource_api/pull/368) ([LukasAud](https://github.com/LukasAud))
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- Provider get() call optimization [#306](https://github.com/puppetlabs/puppet-resource_api/pull/306) ([seanmil](https://github.com/seanmil))
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
|
22
|
+
- Fix instances method with simple_get_filter [#304](https://github.com/puppetlabs/puppet-resource_api/pull/304) ([seanmil](https://github.com/seanmil))
|
23
|
+
- SimpleProvider name fixes [#302](https://github.com/puppetlabs/puppet-resource_api/pull/302) ([seanmil](https://github.com/seanmil))
|
24
|
+
- Various Rubocop fixes
|
25
|
+
|
26
|
+
## [1.9.0](https://github.com/puppetlabs/puppet-resource_api/tree/1.9.0) - 2023-08-08
|
7
27
|
|
8
28
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.18...1.9.0)
|
9
29
|
|
@@ -11,7 +31,7 @@ All significant changes to this repo will be summarized in this file.
|
|
11
31
|
|
12
32
|
- \(CAT-761\) Add custom\_generate as a feature [\#316](https://github.com/puppetlabs/puppet-resource_api/pull/316) ([david22swan](https://github.com/david22swan))
|
13
33
|
|
14
|
-
## [1.8.18](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.18)
|
34
|
+
## [1.8.18](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.18) - 2023-07-21
|
15
35
|
|
16
36
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.16...1.8.18)
|
17
37
|
|
@@ -29,7 +49,7 @@ All significant changes to this repo will be summarized in this file.
|
|
29
49
|
- \(maint\) Update to Mend [\#311](https://github.com/puppetlabs/puppet-resource_api/pull/311) ([cthorn42](https://github.com/cthorn42))
|
30
50
|
- \(packaging\) Bump to version '1.8.17' \[no-promote\] [\#301](https://github.com/puppetlabs/puppet-resource_api/pull/301) ([tvpartytonight](https://github.com/tvpartytonight))
|
31
51
|
|
32
|
-
## [1.8.16](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.16)
|
52
|
+
## [1.8.16](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.16) - 2022-10-03
|
33
53
|
|
34
54
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.14...1.8.16)
|
35
55
|
|
@@ -44,7 +64,7 @@ All significant changes to this repo will be summarized in this file.
|
|
44
64
|
- Support ensure parameter with Optional data type [\#292](https://github.com/puppetlabs/puppet-resource_api/pull/292) ([seanmil](https://github.com/seanmil))
|
45
65
|
- Only ship needed files [\#289](https://github.com/puppetlabs/puppet-resource_api/pull/289) ([ekohl](https://github.com/ekohl))
|
46
66
|
|
47
|
-
## [1.8.14](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.14)
|
67
|
+
## [1.8.14](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.14) - 2021-06-09
|
48
68
|
|
49
69
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.13...1.8.14)
|
50
70
|
|
@@ -77,7 +97,7 @@ All significant changes to this repo will be summarized in this file.
|
|
77
97
|
- Update rake requirement from ~\> 10.0 to ~\> 13.0 [\#262](https://github.com/puppetlabs/puppet-resource_api/pull/262) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
78
98
|
- \(maint\) update Gemfile to allow use of non-vulnerable rake version 12.3.3 [\#260](https://github.com/puppetlabs/puppet-resource_api/pull/260) ([DavidS](https://github.com/DavidS))
|
79
99
|
|
80
|
-
## [1.8.13](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.13)
|
100
|
+
## [1.8.13](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.13) - 2020-02-19
|
81
101
|
|
82
102
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.12...1.8.13)
|
83
103
|
|
@@ -85,7 +105,7 @@ All significant changes to this repo will be summarized in this file.
|
|
85
105
|
|
86
106
|
- \(IAC-274\) update CHANGELOG [\#259](https://github.com/puppetlabs/puppet-resource_api/pull/259) ([DavidS](https://github.com/DavidS))
|
87
107
|
|
88
|
-
## [1.8.12](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.12)
|
108
|
+
## [1.8.12](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.12) - 2020-02-03
|
89
109
|
|
90
110
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.11...1.8.12)
|
91
111
|
|
@@ -97,7 +117,7 @@ All significant changes to this repo will be summarized in this file.
|
|
97
117
|
|
98
118
|
- Update dependency\_decisions for LicenseFinder 6.0; Fix deprecation warning with outdated win32-service gem pulled in by puppet [\#252](https://github.com/puppetlabs/puppet-resource_api/pull/252) ([DavidS](https://github.com/DavidS))
|
99
119
|
|
100
|
-
## [1.8.11](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.11)
|
120
|
+
## [1.8.11](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.11) - 2019-12-30
|
101
121
|
|
102
122
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.10...1.8.11)
|
103
123
|
|
@@ -115,7 +135,7 @@ All significant changes to this repo will be summarized in this file.
|
|
115
135
|
|
116
136
|
- Pin json gem to older version for JRuby 1.7 [\#249](https://github.com/puppetlabs/puppet-resource_api/pull/249) ([DavidS](https://github.com/DavidS))
|
117
137
|
|
118
|
-
## [1.8.10](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.10)
|
138
|
+
## [1.8.10](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.10) - 2019-11-14
|
119
139
|
|
120
140
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.9...1.8.10)
|
121
141
|
|
@@ -132,7 +152,7 @@ All significant changes to this repo will be summarized in this file.
|
|
132
152
|
|
133
153
|
- \(FM-8740\): Documentation tweaks based on most recent walkthrough [\#246](https://github.com/puppetlabs/puppet-resource_api/pull/246) ([sanfrancrisko](https://github.com/sanfrancrisko))
|
134
154
|
|
135
|
-
## [1.8.9](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.9)
|
155
|
+
## [1.8.9](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.9) - 2019-10-03
|
136
156
|
|
137
157
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.8...1.8.9)
|
138
158
|
|
@@ -148,7 +168,7 @@ All significant changes to this repo will be summarized in this file.
|
|
148
168
|
|
149
169
|
- \(packaging\) Bump to version '1.8.9' [\#239](https://github.com/puppetlabs/puppet-resource_api/pull/239) ([mihaibuzgau](https://github.com/mihaibuzgau))
|
150
170
|
|
151
|
-
## [1.8.8](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.8)
|
171
|
+
## [1.8.8](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.8) - 2019-09-25
|
152
172
|
|
153
173
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.7...1.8.8)
|
154
174
|
|
@@ -157,7 +177,7 @@ All significant changes to this repo will be summarized in this file.
|
|
157
177
|
- \(MODULES-9258\) Remove obsolete documentation [\#229](https://github.com/puppetlabs/puppet-resource_api/pull/229) ([DavidS](https://github.com/DavidS))
|
158
178
|
- CHANGELOG for 1.8.7 [\#206](https://github.com/puppetlabs/puppet-resource_api/pull/206) ([DavidS](https://github.com/DavidS))
|
159
179
|
|
160
|
-
## [1.8.7](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.7)
|
180
|
+
## [1.8.7](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.7) - 2019-09-11
|
161
181
|
|
162
182
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.6...1.8.7)
|
163
183
|
|
@@ -171,7 +191,7 @@ All significant changes to this repo will be summarized in this file.
|
|
171
191
|
- \(MODULES-9258\) Improve referencing and add summary [\#199](https://github.com/puppetlabs/puppet-resource_api/pull/199) ([maxiegit](https://github.com/maxiegit))
|
172
192
|
- \(maint\) Pin both Jruby cells to use `dist: trusty` [\#197](https://github.com/puppetlabs/puppet-resource_api/pull/197) ([da-ar](https://github.com/da-ar))
|
173
193
|
|
174
|
-
## [1.8.6](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.6)
|
194
|
+
## [1.8.6](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.6) - 2019-07-04
|
175
195
|
|
176
196
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.6.5...1.8.6)
|
177
197
|
|
@@ -186,7 +206,7 @@ All significant changes to this repo will be summarized in this file.
|
|
186
206
|
- \(packaging\) Bump to version '1.9.0' \[no-promote\] [\#191](https://github.com/puppetlabs/puppet-resource_api/pull/191) ([gimmyxd](https://github.com/gimmyxd))
|
187
207
|
- \(maint\) retrofitting changelog for the last couple of releases [\#190](https://github.com/puppetlabs/puppet-resource_api/pull/190) ([DavidS](https://github.com/DavidS))
|
188
208
|
|
189
|
-
## [1.6.5](https://github.com/puppetlabs/puppet-resource_api/tree/1.6.5)
|
209
|
+
## [1.6.5](https://github.com/puppetlabs/puppet-resource_api/tree/1.6.5) - 2019-07-04
|
190
210
|
|
191
211
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.5...1.6.5)
|
192
212
|
|
@@ -199,7 +219,7 @@ All significant changes to this repo will be summarized in this file.
|
|
199
219
|
- \(packaging\) Bump to 1.6.5 [\#196](https://github.com/puppetlabs/puppet-resource_api/pull/196) ([gimmyxd](https://github.com/gimmyxd))
|
200
220
|
- \(maint\) test fixes [\#193](https://github.com/puppetlabs/puppet-resource_api/pull/193) ([DavidS](https://github.com/DavidS))
|
201
221
|
|
202
|
-
## [1.8.5](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.5)
|
222
|
+
## [1.8.5](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.5) - 2019-06-24
|
203
223
|
|
204
224
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.4...1.8.5)
|
205
225
|
|
@@ -216,7 +236,7 @@ All significant changes to this repo will be summarized in this file.
|
|
216
236
|
- \(maint\) test fixes [\#185](https://github.com/puppetlabs/puppet-resource_api/pull/185) ([DavidS](https://github.com/DavidS))
|
217
237
|
- \(maint\) make test order really random [\#175](https://github.com/puppetlabs/puppet-resource_api/pull/175) ([DavidS](https://github.com/DavidS))
|
218
238
|
|
219
|
-
## [1.8.4](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.4)
|
239
|
+
## [1.8.4](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.4) - 2019-06-12
|
220
240
|
|
221
241
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.3...1.8.4)
|
222
242
|
|
@@ -240,7 +260,7 @@ All significant changes to this repo will be summarized in this file.
|
|
240
260
|
- \(maint\) test cleanups [\#172](https://github.com/puppetlabs/puppet-resource_api/pull/172) ([DavidS](https://github.com/DavidS))
|
241
261
|
- \(packaging\) Update reported version to 1.8.4 \[no-promote\] [\#171](https://github.com/puppetlabs/puppet-resource_api/pull/171) ([gimmyxd](https://github.com/gimmyxd))
|
242
262
|
|
243
|
-
## [1.8.3](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.3)
|
263
|
+
## [1.8.3](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.3) - 2019-04-12
|
244
264
|
|
245
265
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.2...1.8.3)
|
246
266
|
|
@@ -252,7 +272,7 @@ All significant changes to this repo will be summarized in this file.
|
|
252
272
|
|
253
273
|
- \(PA-2496\) Bump version and remove v from version number [\#170](https://github.com/puppetlabs/puppet-resource_api/pull/170) ([mihaibuzgau](https://github.com/mihaibuzgau))
|
254
274
|
|
255
|
-
## [1.8.2](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.2)
|
275
|
+
## [1.8.2](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.2) - 2019-04-10
|
256
276
|
|
257
277
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.4...1.8.2)
|
258
278
|
|
@@ -262,7 +282,7 @@ All significant changes to this repo will be summarized in this file.
|
|
262
282
|
- Add `implementations` to reserved bolt keywords [\#165](https://github.com/puppetlabs/puppet-resource_api/pull/165) ([DavidS](https://github.com/DavidS))
|
263
283
|
- Release prep for v1.8.1 [\#163](https://github.com/puppetlabs/puppet-resource_api/pull/163) ([DavidS](https://github.com/DavidS))
|
264
284
|
|
265
|
-
## [v1.6.4](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.4)
|
285
|
+
## [v1.6.4](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.4) - 2019-03-25
|
266
286
|
|
267
287
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.8.1...v1.6.4)
|
268
288
|
|
@@ -270,7 +290,7 @@ All significant changes to this repo will be summarized in this file.
|
|
270
290
|
|
271
291
|
- \(MAINT\) Bump version [\#164](https://github.com/puppetlabs/puppet-resource_api/pull/164) ([sebastian-miclea](https://github.com/sebastian-miclea))
|
272
292
|
|
273
|
-
## [v1.8.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.8.1)
|
293
|
+
## [v1.8.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.8.1) - 2019-03-13
|
274
294
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.8.0...v1.8.1)
|
275
295
|
|
276
296
|
**Fixed bugs:**
|
@@ -284,7 +304,7 @@ All significant changes to this repo will be summarized in this file.
|
|
284
304
|
- \(maint\) update release docs [\#159](https://github.com/puppetlabs/puppet-resource_api/pull/159) ([DavidS](https://github.com/DavidS))
|
285
305
|
- Improve travis cells and testing [\#145](https://github.com/puppetlabs/puppet-resource_api/pull/145) ([DavidS](https://github.com/DavidS))
|
286
306
|
|
287
|
-
## [v1.8.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.8.0)
|
307
|
+
## [v1.8.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.8.0) - 2019-02-26
|
288
308
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.7.0...v1.8.0)
|
289
309
|
|
290
310
|
**Implemented enhancements:**
|
@@ -307,7 +327,7 @@ All significant changes to this repo will be summarized in this file.
|
|
307
327
|
- \(FM-7726\) cleanups for the transport [\#153](https://github.com/puppetlabs/puppet-resource_api/pull/153) ([DavidS](https://github.com/DavidS))
|
308
328
|
- \(FM-7691,FM-7696\) refactoring definition handling in contexts [\#150](https://github.com/puppetlabs/puppet-resource_api/pull/150) ([DavidS](https://github.com/DavidS))
|
309
329
|
|
310
|
-
## [v1.7.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.7.0)
|
330
|
+
## [v1.7.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.7.0) - 2019-01-07
|
311
331
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.3...v1.7.0)
|
312
332
|
|
313
333
|
**Implemented enhancements:**
|
@@ -320,7 +340,7 @@ All significant changes to this repo will be summarized in this file.
|
|
320
340
|
- \(FM-7597\) RSAPI Transport register function [\#146](https://github.com/puppetlabs/puppet-resource_api/pull/146) ([da-ar](https://github.com/da-ar))
|
321
341
|
- \(packaging\) Update version to 1.7.0 [\#144](https://github.com/puppetlabs/puppet-resource_api/pull/144) ([branan](https://github.com/branan))
|
322
342
|
|
323
|
-
## [v1.6.3](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.3)
|
343
|
+
## [v1.6.3](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.3) - 2018-12-11
|
324
344
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.2...v1.6.3)
|
325
345
|
|
326
346
|
**Closed issues:**
|
@@ -336,7 +356,7 @@ All significant changes to this repo will be summarized in this file.
|
|
336
356
|
- \(maint\) extract data type handling code [\#137](https://github.com/puppetlabs/puppet-resource_api/pull/137) ([bpietraga](https://github.com/bpietraga))
|
337
357
|
- Release prep for v1.6.2 [\#135](https://github.com/puppetlabs/puppet-resource_api/pull/135) ([DavidS](https://github.com/DavidS))
|
338
358
|
|
339
|
-
## [v1.6.2](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.2)
|
359
|
+
## [v1.6.2](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.2) - 2018-10-25
|
340
360
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.1...v1.6.2)
|
341
361
|
|
342
362
|
**Fixed bugs:**
|
@@ -347,7 +367,7 @@ All significant changes to this repo will be summarized in this file.
|
|
347
367
|
|
348
368
|
- Release prep for v1.6.1 [\#133](https://github.com/puppetlabs/puppet-resource_api/pull/133) ([DavidS](https://github.com/DavidS))
|
349
369
|
|
350
|
-
## [v1.6.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.1)
|
370
|
+
## [v1.6.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.1) - 2018-10-25
|
351
371
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.0...v1.6.1)
|
352
372
|
|
353
373
|
**Fixed bugs:**
|
@@ -362,7 +382,7 @@ All significant changes to this repo will be summarized in this file.
|
|
362
382
|
- Adjust announcement template to reality [\#128](https://github.com/puppetlabs/puppet-resource_api/pull/128) ([DavidS](https://github.com/DavidS))
|
363
383
|
- Release prep for v1.6.0 [\#127](https://github.com/puppetlabs/puppet-resource_api/pull/127) ([da-ar](https://github.com/da-ar))
|
364
384
|
|
365
|
-
## [v1.6.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.0)
|
385
|
+
## [v1.6.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.6.0) - 2018-09-25
|
366
386
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.5.0...v1.6.0)
|
367
387
|
|
368
388
|
**Implemented enhancements:**
|
@@ -381,7 +401,7 @@ All significant changes to this repo will be summarized in this file.
|
|
381
401
|
- \(maint\) Add Travis job for Puppet 6.0.x branch [\#120](https://github.com/puppetlabs/puppet-resource_api/pull/120) ([da-ar](https://github.com/da-ar))
|
382
402
|
- Release prep for v1.5.0 [\#119](https://github.com/puppetlabs/puppet-resource_api/pull/119) ([DavidS](https://github.com/DavidS))
|
383
403
|
|
384
|
-
## [v1.5.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.5.0)
|
404
|
+
## [v1.5.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.5.0) - 2018-09-12
|
385
405
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.4.2...v1.5.0)
|
386
406
|
|
387
407
|
**Implemented enhancements:**
|
@@ -398,7 +418,7 @@ All significant changes to this repo will be summarized in this file.
|
|
398
418
|
|
399
419
|
- Release prep for v1.4.2 [\#112](https://github.com/puppetlabs/puppet-resource_api/pull/112) ([DavidS](https://github.com/DavidS))
|
400
420
|
|
401
|
-
## [v1.4.2](https://github.com/puppetlabs/puppet-resource_api/tree/v1.4.2)
|
421
|
+
## [v1.4.2](https://github.com/puppetlabs/puppet-resource_api/tree/v1.4.2) - 2018-08-09
|
402
422
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.4.1...v1.4.2)
|
403
423
|
|
404
424
|
**Fixed bugs:**
|
@@ -410,7 +430,7 @@ All significant changes to this repo will be summarized in this file.
|
|
410
430
|
- \(maint\) fix brace alignment; document reference [\#111](https://github.com/puppetlabs/puppet-resource_api/pull/111) ([DavidS](https://github.com/DavidS))
|
411
431
|
- Release prep for v1.4.1 [\#109](https://github.com/puppetlabs/puppet-resource_api/pull/109) ([DavidS](https://github.com/DavidS))
|
412
432
|
|
413
|
-
## [v1.4.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.4.1)
|
433
|
+
## [v1.4.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.4.1) - 2018-07-20
|
414
434
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.4.0...v1.4.1)
|
415
435
|
|
416
436
|
**Fixed bugs:**
|
@@ -424,7 +444,7 @@ All significant changes to this repo will be summarized in this file.
|
|
424
444
|
- Minor changes to README [\#106](https://github.com/puppetlabs/puppet-resource_api/pull/106) ([clairecadman](https://github.com/clairecadman))
|
425
445
|
- Release prep for v1.4.0 [\#102](https://github.com/puppetlabs/puppet-resource_api/pull/102) ([DavidS](https://github.com/DavidS))
|
426
446
|
|
427
|
-
## [v1.4.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.4.0)
|
447
|
+
## [v1.4.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.4.0) - 2018-06-19
|
428
448
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.3.0...v1.4.0)
|
429
449
|
|
430
450
|
**Implemented enhancements:**
|
@@ -451,7 +471,7 @@ All significant changes to this repo will be summarized in this file.
|
|
451
471
|
- Update release docs and announcement template [\#86](https://github.com/puppetlabs/puppet-resource_api/pull/86) ([DavidS](https://github.com/DavidS))
|
452
472
|
- Release prep for v1.3.0 [\#85](https://github.com/puppetlabs/puppet-resource_api/pull/85) ([da-ar](https://github.com/da-ar))
|
453
473
|
|
454
|
-
## [v1.3.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.3.0)
|
474
|
+
## [v1.3.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.3.0) - 2018-05-24
|
455
475
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.2.0...v1.3.0)
|
456
476
|
|
457
477
|
**Implemented enhancements:**
|
@@ -473,7 +493,7 @@ All significant changes to this repo will be summarized in this file.
|
|
473
493
|
- Some glue fixes: announcement, to\_manifest, to\_hierayaml [\#77](https://github.com/puppetlabs/puppet-resource_api/pull/77) ([DavidS](https://github.com/DavidS))
|
474
494
|
- Release prep for v1.2.0 [\#75](https://github.com/puppetlabs/puppet-resource_api/pull/75) ([DavidS](https://github.com/DavidS))
|
475
495
|
|
476
|
-
## [v1.2.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.2.0)
|
496
|
+
## [v1.2.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.2.0) - 2018-05-08
|
477
497
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.1.0...v1.2.0)
|
478
498
|
|
479
499
|
**Implemented enhancements:**
|
@@ -495,7 +515,7 @@ All significant changes to this repo will be summarized in this file.
|
|
495
515
|
- Cache ~/.rvm for jruby jobs [\#66](https://github.com/puppetlabs/puppet-resource_api/pull/66) ([cotsog](https://github.com/cotsog))
|
496
516
|
- Release prep for v1.1.0 [\#64](https://github.com/puppetlabs/puppet-resource_api/pull/64) ([DavidS](https://github.com/DavidS))
|
497
517
|
|
498
|
-
## [v1.1.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.1.0)
|
518
|
+
## [v1.1.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.1.0) - 2018-04-12
|
499
519
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.3...v1.1.0)
|
500
520
|
|
501
521
|
**Implemented enhancements:**
|
@@ -513,7 +533,7 @@ All significant changes to this repo will be summarized in this file.
|
|
513
533
|
- Update puppetlabs\_spec\_helper to fixed master version [\#58](https://github.com/puppetlabs/puppet-resource_api/pull/58) ([DavidS](https://github.com/DavidS))
|
514
534
|
- Release prep for v1.0.3 [\#57](https://github.com/puppetlabs/puppet-resource_api/pull/57) ([DavidS](https://github.com/DavidS))
|
515
535
|
|
516
|
-
## [v1.0.3](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.3)
|
536
|
+
## [v1.0.3](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.3) - 2018-04-06
|
517
537
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.2...v1.0.3)
|
518
538
|
|
519
539
|
**Implemented enhancements:**
|
@@ -532,7 +552,7 @@ All significant changes to this repo will be summarized in this file.
|
|
532
552
|
- Update release prep notes [\#51](https://github.com/puppetlabs/puppet-resource_api/pull/51) ([DavidS](https://github.com/DavidS))
|
533
553
|
- Release prep for v1.0.2 [\#50](https://github.com/puppetlabs/puppet-resource_api/pull/50) ([DavidS](https://github.com/DavidS))
|
534
554
|
|
535
|
-
## [v1.0.2](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.2)
|
555
|
+
## [v1.0.2](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.2) - 2018-03-26
|
536
556
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.1...v1.0.2)
|
537
557
|
|
538
558
|
**Implemented enhancements:**
|
@@ -548,7 +568,7 @@ All significant changes to this repo will be summarized in this file.
|
|
548
568
|
|
549
569
|
- \(PDK-810\) run CI against all the versions [\#46](https://github.com/puppetlabs/puppet-resource_api/pull/46) ([DavidS](https://github.com/DavidS))
|
550
570
|
|
551
|
-
## [v1.0.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.1)
|
571
|
+
## [v1.0.1](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.1) - 2018-03-23
|
552
572
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.0...v1.0.1)
|
553
573
|
|
554
574
|
**Fixed bugs:**
|
@@ -560,7 +580,7 @@ All significant changes to this repo will be summarized in this file.
|
|
560
580
|
- Release prep for v1.0.1 [\#45](https://github.com/puppetlabs/puppet-resource_api/pull/45) ([DavidS](https://github.com/DavidS))
|
561
581
|
- Release prep for v1.0.0 [\#43](https://github.com/puppetlabs/puppet-resource_api/pull/43) ([da-ar](https://github.com/da-ar))
|
562
582
|
|
563
|
-
## [v1.0.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.0)
|
583
|
+
## [v1.0.0](https://github.com/puppetlabs/puppet-resource_api/tree/v1.0.0) - 2018-03-23
|
564
584
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.10.0...v1.0.0)
|
565
585
|
|
566
586
|
**Implemented enhancements:**
|
@@ -577,7 +597,7 @@ All significant changes to this repo will be summarized in this file.
|
|
577
597
|
- Notes on how to build a release [\#39](https://github.com/puppetlabs/puppet-resource_api/pull/39) ([DavidS](https://github.com/DavidS))
|
578
598
|
- Release prep for v0.10.0 [\#38](https://github.com/puppetlabs/puppet-resource_api/pull/38) ([DavidS](https://github.com/DavidS))
|
579
599
|
|
580
|
-
## [v0.10.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.10.0)
|
600
|
+
## [v0.10.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.10.0) - 2018-03-21
|
581
601
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.9.0...v0.10.0)
|
582
602
|
|
583
603
|
**Implemented enhancements:**
|
@@ -595,7 +615,7 @@ All significant changes to this repo will be summarized in this file.
|
|
595
615
|
- Cleanup test module [\#33](https://github.com/puppetlabs/puppet-resource_api/pull/33) ([DavidS](https://github.com/DavidS))
|
596
616
|
- Update to rubocop 0.53.0 [\#32](https://github.com/puppetlabs/puppet-resource_api/pull/32) ([DavidS](https://github.com/DavidS))
|
597
617
|
|
598
|
-
## [v0.9.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.9.0)
|
618
|
+
## [v0.9.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.9.0) - 2018-02-22
|
599
619
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.3.0...v0.9.0)
|
600
620
|
|
601
621
|
**Implemented enhancements:**
|
@@ -613,7 +633,7 @@ All significant changes to this repo will be summarized in this file.
|
|
613
633
|
- Add a note on device support to the README [\#26](https://github.com/puppetlabs/puppet-resource_api/pull/26) ([DavidS](https://github.com/DavidS))
|
614
634
|
- Remove Command API [\#25](https://github.com/puppetlabs/puppet-resource_api/pull/25) ([DavidS](https://github.com/DavidS))
|
615
635
|
|
616
|
-
## [v0.3.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.3.0)
|
636
|
+
## [v0.3.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.3.0) - 2018-02-21
|
617
637
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.2.2...v0.3.0)
|
618
638
|
|
619
639
|
**Implemented enhancements:**
|
@@ -630,7 +650,7 @@ All significant changes to this repo will be summarized in this file.
|
|
630
650
|
|
631
651
|
- Release prep v0.3.0 [\#22](https://github.com/puppetlabs/puppet-resource_api/pull/22) ([DavidS](https://github.com/DavidS))
|
632
652
|
|
633
|
-
## [v0.2.2](https://github.com/puppetlabs/puppet-resource_api/tree/v0.2.2)
|
653
|
+
## [v0.2.2](https://github.com/puppetlabs/puppet-resource_api/tree/v0.2.2) - 2018-01-25
|
634
654
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.2.1...v0.2.2)
|
635
655
|
|
636
656
|
**Fixed bugs:**
|
@@ -641,7 +661,7 @@ All significant changes to this repo will be summarized in this file.
|
|
641
661
|
|
642
662
|
- Release prep v0.2.2 [\#16](https://github.com/puppetlabs/puppet-resource_api/pull/16) ([DavidS](https://github.com/DavidS))
|
643
663
|
|
644
|
-
## [v0.2.1](https://github.com/puppetlabs/puppet-resource_api/tree/v0.2.1)
|
664
|
+
## [v0.2.1](https://github.com/puppetlabs/puppet-resource_api/tree/v0.2.1) - 2018-01-24
|
645
665
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.2.0...v0.2.1)
|
646
666
|
|
647
667
|
**Fixed bugs:**
|
@@ -652,7 +672,7 @@ All significant changes to this repo will be summarized in this file.
|
|
652
672
|
|
653
673
|
- Release prep [\#14](https://github.com/puppetlabs/puppet-resource_api/pull/14) ([DavidS](https://github.com/DavidS))
|
654
674
|
|
655
|
-
## [v0.2.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.2.0)
|
675
|
+
## [v0.2.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.2.0) - 2018-01-23
|
656
676
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.1.0...v0.2.0)
|
657
677
|
|
658
678
|
**Implemented enhancements:**
|
@@ -669,7 +689,7 @@ All significant changes to this repo will be summarized in this file.
|
|
669
689
|
- Release Prep for 0.2.0 [\#9](https://github.com/puppetlabs/puppet-resource_api/pull/9) ([DavidS](https://github.com/DavidS))
|
670
690
|
- Small fixes [\#7](https://github.com/puppetlabs/puppet-resource_api/pull/7) ([DavidS](https://github.com/DavidS))
|
671
691
|
|
672
|
-
## [v0.1.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.1.0)
|
692
|
+
## [v0.1.0](https://github.com/puppetlabs/puppet-resource_api/tree/v0.1.0) - 2017-11-17
|
673
693
|
**Merged pull requests:**
|
674
694
|
|
675
695
|
- \(maint\) sort dependencies in gemspec [\#6](https://github.com/puppetlabs/puppet-resource_api/pull/6) ([DavidS](https://github.com/DavidS))
|
@@ -19,7 +19,7 @@ class Puppet::ResourceApi::BaseContext
|
|
19
19
|
elsif definition.is_a? Puppet::ResourceApi::BaseTypeDefinition
|
20
20
|
@type = definition
|
21
21
|
else
|
22
|
-
raise ArgumentError, 'BaseContext requires definition to be a child of Puppet::ResourceApi::BaseTypeDefinition, not
|
22
|
+
raise ArgumentError, format('BaseContext requires definition to be a child of Puppet::ResourceApi::BaseTypeDefinition, not <%<actual_type>s>', actual_type: definition.class)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -44,7 +44,7 @@ class Puppet::ResourceApi::BaseContext
|
|
44
44
|
type.feature?(feature)
|
45
45
|
end
|
46
46
|
|
47
|
-
[
|
47
|
+
%i[debug info notice warning err].each do |level|
|
48
48
|
define_method(level) do |*args|
|
49
49
|
if args.length == 1
|
50
50
|
message = "#{@context || @type.name}: #{args.last}"
|
@@ -58,7 +58,7 @@ class Puppet::ResourceApi::BaseContext
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
[
|
61
|
+
%i[creating updating deleting].each do |method|
|
62
62
|
define_method(method) do |titles, message: method.to_s.capitalize, &block|
|
63
63
|
start_time = Time.now
|
64
64
|
setup_context(titles, message)
|
@@ -92,6 +92,7 @@ class Puppet::ResourceApi::BaseContext
|
|
92
92
|
|
93
93
|
def processing(title, is, should, message = 'Processing')
|
94
94
|
raise "#{__method__} only accepts a single resource title" if title.respond_to?(:each)
|
95
|
+
|
95
96
|
start_time = Time.now
|
96
97
|
setup_context(title, message)
|
97
98
|
begin
|
@@ -106,7 +107,7 @@ class Puppet::ResourceApi::BaseContext
|
|
106
107
|
end
|
107
108
|
end
|
108
109
|
|
109
|
-
[
|
110
|
+
%i[created updated deleted].each do |method|
|
110
111
|
define_method(method) do |titles, message: method.to_s.capitalize|
|
111
112
|
notice("#{message}: #{titles}")
|
112
113
|
end
|
@@ -114,11 +115,13 @@ class Puppet::ResourceApi::BaseContext
|
|
114
115
|
|
115
116
|
def processed(title, is, should)
|
116
117
|
raise "#{__method__} only accepts a single resource title" if title.respond_to?(:each)
|
118
|
+
|
117
119
|
notice("Processed #{title} from #{is} to #{should}")
|
118
120
|
end
|
119
121
|
|
120
122
|
def attribute_changed(title, attribute, is, should, message: nil)
|
121
123
|
raise "#{__method__} only accepts a single resource title" if title.respond_to?(:each)
|
124
|
+
|
122
125
|
printable_is = 'nil'
|
123
126
|
printable_should = 'nil'
|
124
127
|
if is
|
@@ -156,7 +159,7 @@ class Puppet::ResourceApi::BaseContext
|
|
156
159
|
private
|
157
160
|
|
158
161
|
def format_titles(titles)
|
159
|
-
if titles.
|
162
|
+
if titles.empty? && !titles.is_a?(String)
|
160
163
|
@type.name
|
161
164
|
else
|
162
165
|
"#{@type.name}[#{[titles].flatten.compact.join(', ')}]"
|
@@ -169,7 +172,8 @@ class Puppet::ResourceApi::BaseContext
|
|
169
172
|
end
|
170
173
|
|
171
174
|
def format_seconds(seconds)
|
172
|
-
return '%.6f'
|
173
|
-
|
175
|
+
return format('%.6f', seconds) if seconds < 1
|
176
|
+
|
177
|
+
format('%.2f', seconds)
|
174
178
|
end
|
175
179
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module Puppet; module ResourceApi; end; end # predeclare the main module # rubocop:disable Style/Documentation
|
3
|
+
module Puppet; module ResourceApi; end; end # predeclare the main module # rubocop:disable Style/Documentation
|
4
4
|
|
5
5
|
# This module is used to handle data inside types, contains methods for munging
|
6
6
|
# and validation of the type values.
|
@@ -20,12 +20,12 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
20
20
|
# @param unpack_strings[Boolean] unpacking of strings for migrating off
|
21
21
|
# legacy type
|
22
22
|
# @return [type] the cleaned value
|
23
|
-
def self.mungify(type, value, error_msg_prefix, unpack_strings = false)
|
23
|
+
def self.mungify(type, value, error_msg_prefix, unpack_strings = false) # rubocop:disable Style/OptionalBooleanParameter
|
24
24
|
cleaned_value = mungify_core(
|
25
25
|
type,
|
26
26
|
value,
|
27
27
|
error_msg_prefix,
|
28
|
-
unpack_strings
|
28
|
+
unpack_strings
|
29
29
|
)
|
30
30
|
validate(type, cleaned_value, error_msg_prefix)
|
31
31
|
cleaned_value
|
@@ -42,13 +42,14 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
42
42
|
# @return [type] the cleaned value
|
43
43
|
# @raise [Puppet::ResourceError] if `value` could not be parsed into `type`
|
44
44
|
# @private
|
45
|
-
def self.mungify_core(type, value, error_msg_prefix, unpack_strings = false)
|
45
|
+
def self.mungify_core(type, value, error_msg_prefix, unpack_strings = false) # rubocop:disable Style/OptionalBooleanParameter
|
46
46
|
if unpack_strings
|
47
47
|
# When the provider is exercised from the `puppet resource` CLI, we need
|
48
48
|
# to unpack strings into the correct types, e.g. "1" (a string)
|
49
49
|
# to 1 (an integer)
|
50
50
|
cleaned_value, error_msg = try_mungify(type, value, error_msg_prefix)
|
51
51
|
raise Puppet::ResourceError, error_msg if error_msg
|
52
|
+
|
52
53
|
cleaned_value
|
53
54
|
elsif value == :false # rubocop:disable Lint/BooleanSymbol
|
54
55
|
# work around https://tickets.puppetlabs.com/browse/PUP-2368
|
@@ -77,18 +78,14 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
77
78
|
end
|
78
79
|
# only convert the values if none failed. otherwise fall through and
|
79
80
|
# rely on puppet to render a proper error
|
80
|
-
if conversions.all? { |c| c[1].nil? }
|
81
|
-
value = conversions.map { |c| c[0] }
|
82
|
-
end
|
81
|
+
value = conversions.map { |c| c[0] } if conversions.all? { |c| c[1].nil? }
|
83
82
|
end
|
84
83
|
when Puppet::Pops::Types::PBooleanType
|
85
84
|
value = boolean_munge(value)
|
86
85
|
when Puppet::Pops::Types::PIntegerType,
|
87
86
|
Puppet::Pops::Types::PFloatType,
|
88
87
|
Puppet::Pops::Types::PNumericType
|
89
|
-
if value.is_a?(String) && (value.match?(
|
90
|
-
value = Puppet::Pops::Utils.to_n(value)
|
91
|
-
end
|
88
|
+
value = Puppet::Pops::Utils.to_n(value) if value.is_a?(String) && (value.match?(/^-?\d+$/) || value.match?(Puppet::Pops::Patterns::NUMERIC))
|
92
89
|
when Puppet::Pops::Types::PEnumType,
|
93
90
|
Puppet::Pops::Types::PStringType,
|
94
91
|
Puppet::Pops::Types::PPatternType
|
@@ -109,9 +106,7 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
109
106
|
return conversion_results[0] if conversion_results.length == 1
|
110
107
|
|
111
108
|
# return an error if ambiguous
|
112
|
-
if conversion_results.length > 1
|
113
|
-
return [nil, ambiguous_error_msg(error_msg_prefix, value, type)]
|
114
|
-
end
|
109
|
+
return [nil, ambiguous_error_msg(error_msg_prefix, value, type)] if conversion_results.length > 1
|
115
110
|
|
116
111
|
# try to interpret as string
|
117
112
|
return try_mungify(string_type, value, error_msg_prefix) if string_type
|
@@ -121,6 +116,7 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
121
116
|
|
122
117
|
error_msg = try_validate(type, value, error_msg_prefix)
|
123
118
|
return [nil, error_msg] if error_msg # an error
|
119
|
+
|
124
120
|
[value, nil] # match
|
125
121
|
end
|
126
122
|
|
@@ -146,7 +142,7 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
146
142
|
# @private
|
147
143
|
def self.ambiguous_error_msg(error_msg_prefix, value, type)
|
148
144
|
"#{error_msg_prefix} #{value.inspect} is not unabiguously convertable to " \
|
149
|
-
|
145
|
+
"#{type}"
|
150
146
|
end
|
151
147
|
|
152
148
|
# Validates the `value` against the specified `type`.
|
@@ -171,16 +167,16 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
171
167
|
|
172
168
|
# an error :-(
|
173
169
|
inferred_type = Puppet::Pops::Types::TypeCalculator.infer_set(value)
|
174
|
-
|
170
|
+
Puppet::Pops::Types::TypeMismatchDescriber.new.describe_mismatch(
|
175
171
|
error_msg_prefix,
|
176
172
|
type,
|
177
|
-
inferred_type
|
173
|
+
inferred_type
|
178
174
|
)
|
179
|
-
error_msg
|
180
175
|
end
|
181
176
|
|
182
177
|
def self.validate_ensure(definition)
|
183
178
|
return unless definition[:attributes].key? :ensure
|
179
|
+
|
184
180
|
options = definition[:attributes][:ensure]
|
185
181
|
type = parse_puppet_type(:ensure, options[:type])
|
186
182
|
|
@@ -199,9 +195,9 @@ module Puppet::ResourceApi::DataTypeHandling
|
|
199
195
|
Puppet::Pops::Types::TypeParser.singleton.parse(type)
|
200
196
|
rescue Puppet::ParseErrorWithIssue => e
|
201
197
|
raise Puppet::DevError, "The type of the `#{attr_name}` attribute " \
|
202
|
-
|
198
|
+
"`#{type}` could not be parsed: #{e.message}"
|
203
199
|
rescue Puppet::ParseError => e
|
204
200
|
raise Puppet::DevError, "The type of the `#{attr_name}` attribute " \
|
205
|
-
|
201
|
+
"`#{type}` is not recognised: #{e.message}"
|
206
202
|
end
|
207
203
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'yaml'
|
4
4
|
|
5
5
|
module Puppet; end # rubocop:disable Style/Documentation
|
6
|
+
|
6
7
|
module Puppet::ResourceApi
|
7
8
|
# A trivial class to provide the functionality required to push data through the existing type/provider parts of puppet
|
8
9
|
class ResourceShim
|
@@ -45,7 +46,7 @@ module Puppet::ResourceApi
|
|
45
46
|
# Convert our resource to yaml for Hiera purposes.
|
46
47
|
def to_hierayaml
|
47
48
|
attributes = Hash[filtered_keys.map { |k| [k.to_s, values[k]] }]
|
48
|
-
YAML.dump('type' => { title => attributes }).split("\n").drop(2).join("\n")
|
49
|
+
"#{YAML.dump('type' => { title => attributes }).split("\n").drop(2).join("\n")}\n"
|
49
50
|
end
|
50
51
|
|
51
52
|
def to_json(*)
|
@@ -70,12 +71,8 @@ module Puppet::ResourceApi
|
|
70
71
|
class MonkeyHash < Hash
|
71
72
|
def <=>(other)
|
72
73
|
result = self.class.name <=> other.class.name
|
73
|
-
if result.zero?
|
74
|
-
|
75
|
-
end
|
76
|
-
if result.zero?
|
77
|
-
result = keys.sort.map { |k| self[k] } <=> other.keys.sort.map { |k| other[k] }
|
78
|
-
end
|
74
|
+
result = keys.sort <=> other.keys.sort if result.zero?
|
75
|
+
result = keys.sort.map { |k| self[k] } <=> other.keys.sort.map { |k| other[k] } if result.zero?
|
79
76
|
result
|
80
77
|
end
|
81
78
|
end
|