Skip to content

Commit 063e230

Browse files
authored
Merge pull request #733 from tj-cisco/version_pattern_fix
Allow setting `python::version` in hiera to `Integer`
2 parents 1690b33 + 23a4331 commit 063e230

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

REFERENCE.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,5 +1212,14 @@ Alias of `Pattern[/^(<|>|<=|>=|==) [0-9]*(\.[0-9]+)*$/, /\Alatest\Z/]`
12121212

12131213
Match all valid versions for python
12141214

1215-
Alias of `Pattern[/\A(python)?[0-9](\.?[0-9])*/, /\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/]`
1215+
Alias of
1216+
1217+
```puppet
1218+
Variant[Integer, Pattern[
1219+
/\A(python)?[0-9](\.?[0-9])*/,
1220+
/\Apypy\Z/,
1221+
/\Asystem\Z/,
1222+
/\Arh-python[0-9]{2}(?:-python)?\Z/
1223+
]]
1224+
```
12161225

types/version.pp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# @summary Match all valid versions for python
22
#
3-
type Python::Version = Pattern[
4-
/\A(python)?[0-9](\.?[0-9])*/,
5-
/\Apypy\Z/,
6-
/\Asystem\Z/,
7-
/\Arh-python[0-9]{2}(?:-python)?\Z/
3+
type Python::Version = Variant[Integer,
4+
Pattern[
5+
/\A(python)?[0-9](\.?[0-9])*/,
6+
/\Apypy\Z/,
7+
/\Asystem\Z/,
8+
/\Arh-python[0-9]{2}(?:-python)?\Z/
9+
]
810
]

0 commit comments

Comments
 (0)