normalize fail message format
Use angle brackets around <$param> in message to make it clear when a variable is blank.
This commit is contained in:
parent
952bea5393
commit
c178b9519a
@ -43,20 +43,19 @@ class ssh (
|
|||||||
$sshd_client_alive_interval = '0',
|
$sshd_client_alive_interval = '0',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# <validating variables>
|
# validate params
|
||||||
validate_re($sshd_password_authentication, '^(yes|no)$', "sshd_password_authentication may be either 'yes' or 'no' and is set to '${sshd_password_authentication}'.")
|
validate_re($sshd_password_authentication, '^(yes|no)$', "sshd_password_authentication may be either 'yes' or 'no' and is set to <${sshd_password_authentication}>.")
|
||||||
validate_re($sshd_allow_tcp_forwarding, '^(yes|no)$', "sshd_allow_tcp_forwarding may be either 'yes' or 'no' and is set to '${sshd_allow_tcp_forwarding}'.")
|
validate_re($sshd_allow_tcp_forwarding, '^(yes|no)$', "sshd_allow_tcp_forwarding may be either 'yes' or 'no' and is set to <${sshd_allow_tcp_forwarding}>.")
|
||||||
validate_re($sshd_x11_forwarding, '^(yes|no)$', "sshd_x11_forwarding may be either 'yes' or 'no' and is set to '${sshd_x11_forwarding}'.")
|
validate_re($sshd_x11_forwarding, '^(yes|no)$', "sshd_x11_forwarding may be either 'yes' or 'no' and is set to <${sshd_x11_forwarding}>.")
|
||||||
validate_re($sshd_use_pam, '^(yes|no)$', "sshd_use_pam may be either 'yes' or 'no' and is set to '${sshd_use_pam}'.")
|
validate_re($sshd_use_pam, '^(yes|no)$', "sshd_use_pam may be either 'yes' or 'no' and is set to <${sshd_use_pam}>.")
|
||||||
if is_integer($sshd_client_alive_interval) == false { fail("sshd_client_alive_interval must be an integer and is set to '${sshd_client_alive_interval}'.") }
|
if is_integer($sshd_client_alive_interval) == false { fail("sshd_client_alive_interval must be an integer and is set to <${sshd_client_alive_interval}>.") }
|
||||||
# </validating variables>
|
|
||||||
|
|
||||||
case $permit_root_login {
|
case $permit_root_login {
|
||||||
'no', 'yes', 'without-password', 'forced-commands-only': {
|
'no', 'yes', 'without-password', 'forced-commands-only': {
|
||||||
# noop
|
# noop
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("permit_root_login may be either 'yes', 'without-password', 'forced-commands-only' or 'no' and is set to ${permit_root_login}")
|
fail("permit_root_login may be either 'yes', 'without-password', 'forced-commands-only' or 'no' and is set to <${permit_root_login}>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +67,7 @@ class ssh (
|
|||||||
$key = $::sshdsakey
|
$key = $::sshdsakey
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("ssh_key_type must be 'ssh-rsa', 'rsa', 'ssh-dsa', or 'dsa' and is ${ssh_key_type}")
|
fail("ssh_key_type must be 'ssh-rsa', 'rsa', 'ssh-dsa', or 'dsa' and is <${ssh_key_type}>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ class ssh (
|
|||||||
# noop
|
# noop
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("purge_keys must be 'true' or 'false' and is ${purge_keys}")
|
fail("purge_keys must be 'true' or 'false' and is <${purge_keys}>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,7 +502,7 @@ describe 'ssh' do
|
|||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should include_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_password_authentication may be either \'yes\' or \'no\' and is set to \'invalid\'./)
|
}.to raise_error(Puppet::Error,/sshd_password_authentication may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ describe 'ssh' do
|
|||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should include_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_allow_tcp_forwarding may be either \'yes\' or \'no\' and is set to \'invalid\'./)
|
}.to raise_error(Puppet::Error,/sshd_allow_tcp_forwarding may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ describe 'ssh' do
|
|||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should include_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_x11_forwarding may be either \'yes\' or \'no\' and is set to \'invalid\'./)
|
}.to raise_error(Puppet::Error,/sshd_x11_forwarding may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -559,7 +559,7 @@ describe 'ssh' do
|
|||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should include_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_use_pam may be either \'yes\' or \'no\' and is set to \'invalid\'./)
|
}.to raise_error(Puppet::Error,/sshd_use_pam may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -578,7 +578,7 @@ describe 'ssh' do
|
|||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should include_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_client_alive_interval must be an integer and is set to \'invalid\'./)
|
}.to raise_error(Puppet::Error,/sshd_client_alive_interval must be an integer and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user