puppet-resource_api 1.9.2 → 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 +57 -52
- 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 -113
- data/lib/puppet/util/network_device/simple/device.rb +2 -0
- metadata +8 -3
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,24 +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
|
|
|
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).
|
|
6
7
|
|
|
7
|
-
[
|
|
8
|
+
## [v2.0.0](https://github.com/puppetlabs/puppet-resource_api/tree/v2.0.0) - 2025-03-13
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.9.0...v2.0.0)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
### Changed
|
|
12
13
|
|
|
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))
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
### Added
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
- Provider get() call optimization [#306](https://github.com/puppetlabs/puppet-resource_api/pull/306) ([seanmil](https://github.com/seanmil))
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
18
21
|
|
|
19
|
-
-
|
|
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
|
|
20
25
|
|
|
21
|
-
## [1.9.0](https://github.com/puppetlabs/puppet-resource_api/tree/1.9.0)
|
|
26
|
+
## [1.9.0](https://github.com/puppetlabs/puppet-resource_api/tree/1.9.0) - 2023-08-08
|
|
22
27
|
|
|
23
28
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.18...1.9.0)
|
|
24
29
|
|
|
@@ -26,7 +31,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
26
31
|
|
|
27
32
|
- \(CAT-761\) Add custom\_generate as a feature [\#316](https://github.com/puppetlabs/puppet-resource_api/pull/316) ([david22swan](https://github.com/david22swan))
|
|
28
33
|
|
|
29
|
-
## [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
|
|
30
35
|
|
|
31
36
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.16...1.8.18)
|
|
32
37
|
|
|
@@ -44,7 +49,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
44
49
|
- \(maint\) Update to Mend [\#311](https://github.com/puppetlabs/puppet-resource_api/pull/311) ([cthorn42](https://github.com/cthorn42))
|
|
45
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))
|
|
46
51
|
|
|
47
|
-
## [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
|
|
48
53
|
|
|
49
54
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.14...1.8.16)
|
|
50
55
|
|
|
@@ -59,7 +64,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
59
64
|
- Support ensure parameter with Optional data type [\#292](https://github.com/puppetlabs/puppet-resource_api/pull/292) ([seanmil](https://github.com/seanmil))
|
|
60
65
|
- Only ship needed files [\#289](https://github.com/puppetlabs/puppet-resource_api/pull/289) ([ekohl](https://github.com/ekohl))
|
|
61
66
|
|
|
62
|
-
## [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
|
|
63
68
|
|
|
64
69
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.13...1.8.14)
|
|
65
70
|
|
|
@@ -92,7 +97,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
92
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))
|
|
93
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))
|
|
94
99
|
|
|
95
|
-
## [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
|
|
96
101
|
|
|
97
102
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.12...1.8.13)
|
|
98
103
|
|
|
@@ -100,7 +105,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
100
105
|
|
|
101
106
|
- \(IAC-274\) update CHANGELOG [\#259](https://github.com/puppetlabs/puppet-resource_api/pull/259) ([DavidS](https://github.com/DavidS))
|
|
102
107
|
|
|
103
|
-
## [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
|
|
104
109
|
|
|
105
110
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.11...1.8.12)
|
|
106
111
|
|
|
@@ -112,7 +117,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
112
117
|
|
|
113
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))
|
|
114
119
|
|
|
115
|
-
## [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
|
|
116
121
|
|
|
117
122
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.10...1.8.11)
|
|
118
123
|
|
|
@@ -130,7 +135,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
130
135
|
|
|
131
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))
|
|
132
137
|
|
|
133
|
-
## [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
|
|
134
139
|
|
|
135
140
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.9...1.8.10)
|
|
136
141
|
|
|
@@ -147,7 +152,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
147
152
|
|
|
148
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))
|
|
149
154
|
|
|
150
|
-
## [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
|
|
151
156
|
|
|
152
157
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.8...1.8.9)
|
|
153
158
|
|
|
@@ -163,7 +168,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
163
168
|
|
|
164
169
|
- \(packaging\) Bump to version '1.8.9' [\#239](https://github.com/puppetlabs/puppet-resource_api/pull/239) ([mihaibuzgau](https://github.com/mihaibuzgau))
|
|
165
170
|
|
|
166
|
-
## [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
|
|
167
172
|
|
|
168
173
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.7...1.8.8)
|
|
169
174
|
|
|
@@ -172,7 +177,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
172
177
|
- \(MODULES-9258\) Remove obsolete documentation [\#229](https://github.com/puppetlabs/puppet-resource_api/pull/229) ([DavidS](https://github.com/DavidS))
|
|
173
178
|
- CHANGELOG for 1.8.7 [\#206](https://github.com/puppetlabs/puppet-resource_api/pull/206) ([DavidS](https://github.com/DavidS))
|
|
174
179
|
|
|
175
|
-
## [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
|
|
176
181
|
|
|
177
182
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.6...1.8.7)
|
|
178
183
|
|
|
@@ -186,7 +191,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
186
191
|
- \(MODULES-9258\) Improve referencing and add summary [\#199](https://github.com/puppetlabs/puppet-resource_api/pull/199) ([maxiegit](https://github.com/maxiegit))
|
|
187
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))
|
|
188
193
|
|
|
189
|
-
## [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
|
|
190
195
|
|
|
191
196
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.6.5...1.8.6)
|
|
192
197
|
|
|
@@ -201,7 +206,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
201
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))
|
|
202
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))
|
|
203
208
|
|
|
204
|
-
## [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
|
|
205
210
|
|
|
206
211
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.5...1.6.5)
|
|
207
212
|
|
|
@@ -214,7 +219,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
214
219
|
- \(packaging\) Bump to 1.6.5 [\#196](https://github.com/puppetlabs/puppet-resource_api/pull/196) ([gimmyxd](https://github.com/gimmyxd))
|
|
215
220
|
- \(maint\) test fixes [\#193](https://github.com/puppetlabs/puppet-resource_api/pull/193) ([DavidS](https://github.com/DavidS))
|
|
216
221
|
|
|
217
|
-
## [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
|
|
218
223
|
|
|
219
224
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.4...1.8.5)
|
|
220
225
|
|
|
@@ -231,7 +236,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
231
236
|
- \(maint\) test fixes [\#185](https://github.com/puppetlabs/puppet-resource_api/pull/185) ([DavidS](https://github.com/DavidS))
|
|
232
237
|
- \(maint\) make test order really random [\#175](https://github.com/puppetlabs/puppet-resource_api/pull/175) ([DavidS](https://github.com/DavidS))
|
|
233
238
|
|
|
234
|
-
## [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
|
|
235
240
|
|
|
236
241
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.3...1.8.4)
|
|
237
242
|
|
|
@@ -255,7 +260,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
255
260
|
- \(maint\) test cleanups [\#172](https://github.com/puppetlabs/puppet-resource_api/pull/172) ([DavidS](https://github.com/DavidS))
|
|
256
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))
|
|
257
262
|
|
|
258
|
-
## [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
|
|
259
264
|
|
|
260
265
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.2...1.8.3)
|
|
261
266
|
|
|
@@ -267,7 +272,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
267
272
|
|
|
268
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))
|
|
269
274
|
|
|
270
|
-
## [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
|
|
271
276
|
|
|
272
277
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.4...1.8.2)
|
|
273
278
|
|
|
@@ -277,7 +282,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
277
282
|
- Add `implementations` to reserved bolt keywords [\#165](https://github.com/puppetlabs/puppet-resource_api/pull/165) ([DavidS](https://github.com/DavidS))
|
|
278
283
|
- Release prep for v1.8.1 [\#163](https://github.com/puppetlabs/puppet-resource_api/pull/163) ([DavidS](https://github.com/DavidS))
|
|
279
284
|
|
|
280
|
-
## [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
|
|
281
286
|
|
|
282
287
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.8.1...v1.6.4)
|
|
283
288
|
|
|
@@ -285,7 +290,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
285
290
|
|
|
286
291
|
- \(MAINT\) Bump version [\#164](https://github.com/puppetlabs/puppet-resource_api/pull/164) ([sebastian-miclea](https://github.com/sebastian-miclea))
|
|
287
292
|
|
|
288
|
-
## [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
|
|
289
294
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.8.0...v1.8.1)
|
|
290
295
|
|
|
291
296
|
**Fixed bugs:**
|
|
@@ -299,7 +304,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
299
304
|
- \(maint\) update release docs [\#159](https://github.com/puppetlabs/puppet-resource_api/pull/159) ([DavidS](https://github.com/DavidS))
|
|
300
305
|
- Improve travis cells and testing [\#145](https://github.com/puppetlabs/puppet-resource_api/pull/145) ([DavidS](https://github.com/DavidS))
|
|
301
306
|
|
|
302
|
-
## [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
|
|
303
308
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.7.0...v1.8.0)
|
|
304
309
|
|
|
305
310
|
**Implemented enhancements:**
|
|
@@ -322,7 +327,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
322
327
|
- \(FM-7726\) cleanups for the transport [\#153](https://github.com/puppetlabs/puppet-resource_api/pull/153) ([DavidS](https://github.com/DavidS))
|
|
323
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))
|
|
324
329
|
|
|
325
|
-
## [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
|
|
326
331
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.3...v1.7.0)
|
|
327
332
|
|
|
328
333
|
**Implemented enhancements:**
|
|
@@ -335,7 +340,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
335
340
|
- \(FM-7597\) RSAPI Transport register function [\#146](https://github.com/puppetlabs/puppet-resource_api/pull/146) ([da-ar](https://github.com/da-ar))
|
|
336
341
|
- \(packaging\) Update version to 1.7.0 [\#144](https://github.com/puppetlabs/puppet-resource_api/pull/144) ([branan](https://github.com/branan))
|
|
337
342
|
|
|
338
|
-
## [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
|
|
339
344
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.2...v1.6.3)
|
|
340
345
|
|
|
341
346
|
**Closed issues:**
|
|
@@ -351,7 +356,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
351
356
|
- \(maint\) extract data type handling code [\#137](https://github.com/puppetlabs/puppet-resource_api/pull/137) ([bpietraga](https://github.com/bpietraga))
|
|
352
357
|
- Release prep for v1.6.2 [\#135](https://github.com/puppetlabs/puppet-resource_api/pull/135) ([DavidS](https://github.com/DavidS))
|
|
353
358
|
|
|
354
|
-
## [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
|
|
355
360
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.1...v1.6.2)
|
|
356
361
|
|
|
357
362
|
**Fixed bugs:**
|
|
@@ -362,7 +367,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
362
367
|
|
|
363
368
|
- Release prep for v1.6.1 [\#133](https://github.com/puppetlabs/puppet-resource_api/pull/133) ([DavidS](https://github.com/DavidS))
|
|
364
369
|
|
|
365
|
-
## [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
|
|
366
371
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.6.0...v1.6.1)
|
|
367
372
|
|
|
368
373
|
**Fixed bugs:**
|
|
@@ -377,7 +382,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
377
382
|
- Adjust announcement template to reality [\#128](https://github.com/puppetlabs/puppet-resource_api/pull/128) ([DavidS](https://github.com/DavidS))
|
|
378
383
|
- Release prep for v1.6.0 [\#127](https://github.com/puppetlabs/puppet-resource_api/pull/127) ([da-ar](https://github.com/da-ar))
|
|
379
384
|
|
|
380
|
-
## [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
|
|
381
386
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.5.0...v1.6.0)
|
|
382
387
|
|
|
383
388
|
**Implemented enhancements:**
|
|
@@ -396,7 +401,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
396
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))
|
|
397
402
|
- Release prep for v1.5.0 [\#119](https://github.com/puppetlabs/puppet-resource_api/pull/119) ([DavidS](https://github.com/DavidS))
|
|
398
403
|
|
|
399
|
-
## [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
|
|
400
405
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.4.2...v1.5.0)
|
|
401
406
|
|
|
402
407
|
**Implemented enhancements:**
|
|
@@ -413,7 +418,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
413
418
|
|
|
414
419
|
- Release prep for v1.4.2 [\#112](https://github.com/puppetlabs/puppet-resource_api/pull/112) ([DavidS](https://github.com/DavidS))
|
|
415
420
|
|
|
416
|
-
## [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
|
|
417
422
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.4.1...v1.4.2)
|
|
418
423
|
|
|
419
424
|
**Fixed bugs:**
|
|
@@ -425,7 +430,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
425
430
|
- \(maint\) fix brace alignment; document reference [\#111](https://github.com/puppetlabs/puppet-resource_api/pull/111) ([DavidS](https://github.com/DavidS))
|
|
426
431
|
- Release prep for v1.4.1 [\#109](https://github.com/puppetlabs/puppet-resource_api/pull/109) ([DavidS](https://github.com/DavidS))
|
|
427
432
|
|
|
428
|
-
## [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
|
|
429
434
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.4.0...v1.4.1)
|
|
430
435
|
|
|
431
436
|
**Fixed bugs:**
|
|
@@ -439,7 +444,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
439
444
|
- Minor changes to README [\#106](https://github.com/puppetlabs/puppet-resource_api/pull/106) ([clairecadman](https://github.com/clairecadman))
|
|
440
445
|
- Release prep for v1.4.0 [\#102](https://github.com/puppetlabs/puppet-resource_api/pull/102) ([DavidS](https://github.com/DavidS))
|
|
441
446
|
|
|
442
|
-
## [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
|
|
443
448
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.3.0...v1.4.0)
|
|
444
449
|
|
|
445
450
|
**Implemented enhancements:**
|
|
@@ -466,7 +471,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
466
471
|
- Update release docs and announcement template [\#86](https://github.com/puppetlabs/puppet-resource_api/pull/86) ([DavidS](https://github.com/DavidS))
|
|
467
472
|
- Release prep for v1.3.0 [\#85](https://github.com/puppetlabs/puppet-resource_api/pull/85) ([da-ar](https://github.com/da-ar))
|
|
468
473
|
|
|
469
|
-
## [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
|
|
470
475
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.2.0...v1.3.0)
|
|
471
476
|
|
|
472
477
|
**Implemented enhancements:**
|
|
@@ -488,7 +493,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
488
493
|
- Some glue fixes: announcement, to\_manifest, to\_hierayaml [\#77](https://github.com/puppetlabs/puppet-resource_api/pull/77) ([DavidS](https://github.com/DavidS))
|
|
489
494
|
- Release prep for v1.2.0 [\#75](https://github.com/puppetlabs/puppet-resource_api/pull/75) ([DavidS](https://github.com/DavidS))
|
|
490
495
|
|
|
491
|
-
## [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
|
|
492
497
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.1.0...v1.2.0)
|
|
493
498
|
|
|
494
499
|
**Implemented enhancements:**
|
|
@@ -510,7 +515,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
510
515
|
- Cache ~/.rvm for jruby jobs [\#66](https://github.com/puppetlabs/puppet-resource_api/pull/66) ([cotsog](https://github.com/cotsog))
|
|
511
516
|
- Release prep for v1.1.0 [\#64](https://github.com/puppetlabs/puppet-resource_api/pull/64) ([DavidS](https://github.com/DavidS))
|
|
512
517
|
|
|
513
|
-
## [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
|
|
514
519
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.3...v1.1.0)
|
|
515
520
|
|
|
516
521
|
**Implemented enhancements:**
|
|
@@ -528,7 +533,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
528
533
|
- Update puppetlabs\_spec\_helper to fixed master version [\#58](https://github.com/puppetlabs/puppet-resource_api/pull/58) ([DavidS](https://github.com/DavidS))
|
|
529
534
|
- Release prep for v1.0.3 [\#57](https://github.com/puppetlabs/puppet-resource_api/pull/57) ([DavidS](https://github.com/DavidS))
|
|
530
535
|
|
|
531
|
-
## [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
|
|
532
537
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.2...v1.0.3)
|
|
533
538
|
|
|
534
539
|
**Implemented enhancements:**
|
|
@@ -547,7 +552,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
547
552
|
- Update release prep notes [\#51](https://github.com/puppetlabs/puppet-resource_api/pull/51) ([DavidS](https://github.com/DavidS))
|
|
548
553
|
- Release prep for v1.0.2 [\#50](https://github.com/puppetlabs/puppet-resource_api/pull/50) ([DavidS](https://github.com/DavidS))
|
|
549
554
|
|
|
550
|
-
## [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
|
|
551
556
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.1...v1.0.2)
|
|
552
557
|
|
|
553
558
|
**Implemented enhancements:**
|
|
@@ -563,7 +568,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
563
568
|
|
|
564
569
|
- \(PDK-810\) run CI against all the versions [\#46](https://github.com/puppetlabs/puppet-resource_api/pull/46) ([DavidS](https://github.com/DavidS))
|
|
565
570
|
|
|
566
|
-
## [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
|
|
567
572
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v1.0.0...v1.0.1)
|
|
568
573
|
|
|
569
574
|
**Fixed bugs:**
|
|
@@ -575,7 +580,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
575
580
|
- Release prep for v1.0.1 [\#45](https://github.com/puppetlabs/puppet-resource_api/pull/45) ([DavidS](https://github.com/DavidS))
|
|
576
581
|
- Release prep for v1.0.0 [\#43](https://github.com/puppetlabs/puppet-resource_api/pull/43) ([da-ar](https://github.com/da-ar))
|
|
577
582
|
|
|
578
|
-
## [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
|
|
579
584
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.10.0...v1.0.0)
|
|
580
585
|
|
|
581
586
|
**Implemented enhancements:**
|
|
@@ -592,7 +597,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
592
597
|
- Notes on how to build a release [\#39](https://github.com/puppetlabs/puppet-resource_api/pull/39) ([DavidS](https://github.com/DavidS))
|
|
593
598
|
- Release prep for v0.10.0 [\#38](https://github.com/puppetlabs/puppet-resource_api/pull/38) ([DavidS](https://github.com/DavidS))
|
|
594
599
|
|
|
595
|
-
## [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
|
|
596
601
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.9.0...v0.10.0)
|
|
597
602
|
|
|
598
603
|
**Implemented enhancements:**
|
|
@@ -610,7 +615,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
610
615
|
- Cleanup test module [\#33](https://github.com/puppetlabs/puppet-resource_api/pull/33) ([DavidS](https://github.com/DavidS))
|
|
611
616
|
- Update to rubocop 0.53.0 [\#32](https://github.com/puppetlabs/puppet-resource_api/pull/32) ([DavidS](https://github.com/DavidS))
|
|
612
617
|
|
|
613
|
-
## [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
|
|
614
619
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.3.0...v0.9.0)
|
|
615
620
|
|
|
616
621
|
**Implemented enhancements:**
|
|
@@ -628,7 +633,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
628
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))
|
|
629
634
|
- Remove Command API [\#25](https://github.com/puppetlabs/puppet-resource_api/pull/25) ([DavidS](https://github.com/DavidS))
|
|
630
635
|
|
|
631
|
-
## [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
|
|
632
637
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.2.2...v0.3.0)
|
|
633
638
|
|
|
634
639
|
**Implemented enhancements:**
|
|
@@ -645,7 +650,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
645
650
|
|
|
646
651
|
- Release prep v0.3.0 [\#22](https://github.com/puppetlabs/puppet-resource_api/pull/22) ([DavidS](https://github.com/DavidS))
|
|
647
652
|
|
|
648
|
-
## [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
|
|
649
654
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.2.1...v0.2.2)
|
|
650
655
|
|
|
651
656
|
**Fixed bugs:**
|
|
@@ -656,7 +661,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
656
661
|
|
|
657
662
|
- Release prep v0.2.2 [\#16](https://github.com/puppetlabs/puppet-resource_api/pull/16) ([DavidS](https://github.com/DavidS))
|
|
658
663
|
|
|
659
|
-
## [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
|
|
660
665
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.2.0...v0.2.1)
|
|
661
666
|
|
|
662
667
|
**Fixed bugs:**
|
|
@@ -667,7 +672,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
667
672
|
|
|
668
673
|
- Release prep [\#14](https://github.com/puppetlabs/puppet-resource_api/pull/14) ([DavidS](https://github.com/DavidS))
|
|
669
674
|
|
|
670
|
-
## [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
|
|
671
676
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/v0.1.0...v0.2.0)
|
|
672
677
|
|
|
673
678
|
**Implemented enhancements:**
|
|
@@ -684,7 +689,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
684
689
|
- Release Prep for 0.2.0 [\#9](https://github.com/puppetlabs/puppet-resource_api/pull/9) ([DavidS](https://github.com/DavidS))
|
|
685
690
|
- Small fixes [\#7](https://github.com/puppetlabs/puppet-resource_api/pull/7) ([DavidS](https://github.com/DavidS))
|
|
686
691
|
|
|
687
|
-
## [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
|
|
688
693
|
**Merged pull requests:**
|
|
689
694
|
|
|
690
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
|