diff options
author | Gabriel Nagy <gabriel.nagy@puppet.com> | 2021-10-01 14:50:02 +0300 |
---|---|---|
committer | Gabriel Nagy <gabriel.nagy@puppet.com> | 2021-10-01 14:50:02 +0300 |
commit | ed14bbd069d08be4aeb11e3bd723a1d401990ed0 (patch) | |
tree | 9a767e04e35b160a1b7b891353339cdfdebd7d75 /lib/puppet/type | |
parent | 725d4693895c6ec060b16428a918d4cecb85ae2f (diff) | |
download | puppet-hosts_core-ed14bbd069d08be4aeb11e3bd723a1d401990ed0.tar.gz puppet-hosts_core-ed14bbd069d08be4aeb11e3bd723a1d401990ed0.tar.bz2 |
(MODULES-11197) Reenable some cops
Diffstat (limited to 'lib/puppet/type')
-rw-r--r-- | lib/puppet/type/host.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/type/host.rb b/lib/puppet/type/host.rb index 0e7a21c..7dd7de8 100644 --- a/lib/puppet/type/host.rb +++ b/lib/puppet/type/host.rb @@ -55,7 +55,7 @@ Puppet::Type.newtype(:host) do newproperty(:comment) do desc 'A comment that will be attached to the line with a # character.' validate do |value| - if value =~ %r{\n} || value =~ %r{\r} + if value.include?("\n") || value.include?("\r") raise Puppet::Error, _('Comment cannot include newline') end end @@ -85,7 +85,7 @@ Puppet::Type.newtype(:host) do raise Puppet::Error, _('Invalid host name') end end - if value =~ %r{\n} || value =~ %r{\r} + if value.include?("\n") || value.include?("\r") raise Puppet::Error, _('Hostname cannot include newline') end end |