Work with Phil on PR
Numbers are treated as strings, so removed those from the test. Simplified validation of sshd_config_forcecommand to simply check if it is a string.
This commit is contained in:
parent
bc15c75c77
commit
80f77a2000
@ -460,9 +460,7 @@ class ssh (
|
||||
}
|
||||
|
||||
if $sshd_config_forcecommand != undef {
|
||||
if is_string($sshd_config_forcecommand) == false {
|
||||
fail("ssh::sshd_config_forcecommand must be a string. Detected value is ${sshd_config_forcecommand}.")
|
||||
}
|
||||
validate_string($sshd_config_forcecommand)
|
||||
}
|
||||
|
||||
if $sshd_config_match != undef {
|
||||
|
@ -1120,14 +1120,14 @@ describe 'ssh' do
|
||||
end
|
||||
end
|
||||
|
||||
[true,3,2.42,['array'],a = { 'ha' => 'sh' }].each do |value|
|
||||
[true,['array'],a = { 'ha' => 'sh' }].each do |value|
|
||||
context "set to invalid #{value} (as #{value.class})" do
|
||||
let (:params) {{'sshd_config_forcecommand' => value }}
|
||||
|
||||
it 'should fail' do
|
||||
expect {
|
||||
should
|
||||
}.to raise_error(Puppet::Error, /ssh::sshd_config_forcecommand must be a string. Detected value is #{value}/)
|
||||
}.to raise_error(Puppet::Error, /is not a string/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user