From cea73db7792c92fef0915ddcb7e5b72ee360525c Mon Sep 17 00:00:00 2001 From: lrrb Date: Wed, 16 Nov 2016 23:06:37 +0100 Subject: [PATCH 1/1] remove port number from hostname Solve the issue reported in https://tickets.puppetlabs.com/browse/MODULES-4104 : remove the port number from repository location in order to get the host name of the repository. --- manifests/source.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/source.pp b/manifests/source.pp index 9adf6a2..c70a8cc 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -124,8 +124,8 @@ define apt::source( if is_hash($pin) { $_pin = merge($pin, { 'ensure' => $ensure, 'before' => $_before }) } elsif (is_numeric($pin) or is_string($pin)) { - $url_split = split($location, '/') - $host = $url_split[2] + $url_split = split($location, '[:\/]+') + $host = $url_split[1] $_pin = { 'ensure' => $ensure, 'priority' => $pin, -- 2.32.3