Age | Commit message (Collapse) | Author |
|
The time() function takes an argument of a timezone, and always returns
time in epoch format. The epoch format is the number of seconds that
have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
seconds. This means that it is universally the same regardless of
timezones.
I don't know what the timezone argument is supposed to do, and it is not
documented. So lets just make 1.8.7 work like > 1.8.7
|
|
|
|
Previously, the random number generator was seeded with the array or
string to be rotated in addition to any values specifically provided for
seeding. This behavior is potentially insecure in that it allows an
attacker who can modify the source data to choose the post-shuffle
order.
|
|
Tests in the new style produces the following documentation output:
abs
should not eq nil
should run abs() and raise an Puppet::ParseError
should run abs(-34) and return 34
should run abs("-34") and return 34
should run abs(34) and return 34
should run abs("34") and return 34
|
|
Without this patch, Ruby 1.8's Hash#to_s behaviour causes [{1=>2}] to be
treated as "12" when validating values.
|
|
The rspec-puppet matchers don't allow to check the return types, but
this is a pretty rare thing to need to do anyway, so probably not worth
patching rspec-puppet
|
|
|
|
|
|
|
|
Check if file exists before loading with loadyaml. If not, return nil
|
|
|
|
support it.
|
|
Fix off-by-one error in validate_augeas_spec.rb that was causing rspec failure
Even without the gem installed always, this is helpful to avoid errors should augeas be enabled/installed due to something else.
|
|
(MODULES-1715) Add FQDN-based random string generator
|
|
|
|
|
|
|
|
See RFC 1123, Section 2.1
http://tools.ietf.org/html/rfc1123#section-2
|
|
Assert private
|
|
|
|
Dirname typecheck
|
|
As mentioned in #270, private is a reserved keyword in the future parser
which is to be released with Puppet 4. As it stands, this function is
not useable with the future parser so it needs to renamed.
This is a breaking change.
|
|
poikilotherm/feature/master/validate_integer_and_numeric
(MODULES-560) Add new functions validate_numeric() and validate_integer().
|
|
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
|
|
The previous commit to uriescape() changed the implementation to use the ruby default escape list for URI.escape(), but did not change the call triggered when uriescape() was called on an array, triggering ruby errors.
|
|
Add a ceiling function to complement the floor function.
|
|
only worry if the object responds to upcase
|
|
|
|
Fix is_domain_name() so it dup's its incoming argument
to avoid changing the original with a later chomp!
|
|
As per puppetlabs/puppet@292233c, this leaves the global seed in a
deterministic state, which is bad. Puppet::Util.deterministic_rand()
exists to avoid running into this issue, but is only present starting in
Puppet 3.2.0.
|
|
|
|
The `type()` function will cease to work on the new parser because 'type'
is a reserved keyword. The `type3x()` function may be used to continue
similar functionality, but will be deprecated in favor of the built-in
typing system.
The `type_of()` function has been included to introspect types in the
new parser.
|
|
|
|
These specs are pretty much the same as the originals, but now check that the output has the correct replacement for file location
|
|
poikilotherm/feature/master/validate_absolute_path_allow_arrays
Allow array of pathes in validate_absolute_path
|
|
|
|
|
|
|
|
Also add extra test for just 1 argument
|
|
`concat` can now take multiple arguments
|
|
|
|
(MODULES-1329) Allow member to look for array
|
|
Currently, the member function allows one to only find if a variable
is part of an array. Sometimes it is useful to find if an array is part
of a bigger array for validation purpose.
|
|
|
|
This is needed for the future parser which actually treats numbers as
numbers and strings as strings. With this patch you can use range(1,5)
instead of having to quote them like range('1','5').
|
|
Added correct converstions for PB and EB.
|
|
* We were converting Exabytes to bytes as Petabytes.
* Updated tests to cover ever unit.
* Added note that we're going by the old, inaccurate definitions of
Kilobytes, Megabytes, etc, in that we treat them as powers of 2.
|
|
We need to use
unless value.is_a?(String) || value.is_a?(Array)
rather than
klass = value.class
unless [String, Array].include?(klass)
because the klass version enforces type checking which is too strict, and does
not allow us to accept objects wich have extended String (or Array).
For example, generate() function now returns Puppet::Util::Execution::ProcessOutput
which is just a very simple extension of String. While this in it's self was
not intentional (PUP-2306) it is not unreasonable to cope with objects which
extend Strings
|
|
It was discovered that the concat array modifies the arrays passed to it
as an argument as a side effect. This test will ensure that doesn't
happen again.
|
|
|