Allow ports that consist of 5 decimals
This commit is contained in:
parent
2873c1e2e7
commit
b0e0024730
3 changed files with 16 additions and 2 deletions
|
@ -59,7 +59,7 @@ Puppet::Type.newtype(:apt_key) do
|
|||
desc 'The key server to fetch the key from based on the ID. It can either be a domain name or url.'
|
||||
defaultto :'keyserver.ubuntu.com'
|
||||
|
||||
newvalues(/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,4})?$/)
|
||||
newvalues(/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/)
|
||||
end
|
||||
|
||||
newparam(:keyserver_options) do
|
||||
|
|
|
@ -69,7 +69,7 @@ define apt::key (
|
|||
}
|
||||
|
||||
if $key_server {
|
||||
validate_re($key_server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,4})?$'])
|
||||
validate_re($key_server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$'])
|
||||
}
|
||||
|
||||
if $key_options {
|
||||
|
|
|
@ -163,5 +163,19 @@ describe Puppet::Type::type(:apt_key) do
|
|||
:source => '/path/to/a/file'
|
||||
)}.to_not raise_error
|
||||
end
|
||||
|
||||
it 'allows 5-digit ports' do
|
||||
expect { Puppet::Type.type(:apt_key).new(
|
||||
:id => '4BD6EC30',
|
||||
:source => 'http://pgp.mit.edu:12345/key'
|
||||
)}.to_not raise_error
|
||||
end
|
||||
|
||||
it 'allows 5-digit ports when using key servers' do
|
||||
expect { Puppet::Type.type(:apt_key).new(
|
||||
:id => '4BD6EC30',
|
||||
:server => 'http://pgp.mit.edu:12345'
|
||||
)}.to_not raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue