File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/puppet/parser/functions Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 8
8
module Puppet ::Parser ::Functions
9
9
newfunction ( :member , :type => :rvalue , :doc => <<-EOS
10
10
This function determines if a variable is a member of an array.
11
- The variable can either be a string or an array.
11
+ The variable can be a string, fixnum, or array.
12
12
13
13
*Examples:*
14
14
@@ -39,7 +39,11 @@ module Puppet::Parser::Functions
39
39
raise ( Puppet ::ParseError , 'member(): Requires array to work with' )
40
40
end
41
41
42
- if arguments [ 1 ] . is_a? String
42
+ unless arguments [ 1 ] . is_a? String or arguments [ 1 ] . is_a? Fixnum or arguments [ 1 ] . is_a? Array
43
+ raise ( Puppet ::ParseError , 'member(): Item to search for must be a string, fixnum, or array' )
44
+ end
45
+
46
+ if arguments [ 1 ] . is_a? String or arguments [ 1 ] . is_a? Fixnum
43
47
item = Array ( arguments [ 1 ] )
44
48
else
45
49
item = arguments [ 1 ]
You can’t perform that action at this time.
0 commit comments