Skip to content

Commit 2b9b9da

Browse files
LukasAudbastelfreak
authored andcommitted
Switch from merge() to native puppet
1 parent 371eab3 commit 2b9b9da

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

manifests/init.pp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
assert_type(Integer, $update['tries'])
201201
}
202202

203-
$_update = merge($apt::update_defaults, $update)
203+
$_update = $apt::update_defaults + $update
204204
include apt::update
205205

206206
if $purge['sources.list'] {
@@ -222,11 +222,11 @@
222222
assert_type(Boolean, $purge['apt.conf.d'])
223223
}
224224

225-
$_purge = merge($apt::purge_defaults, $purge)
225+
$_purge = $apt::purge_defaults + $purge
226226

227227
if $proxy['perhost'] {
228228
$_perhost = $proxy['perhost'].map |$item| {
229-
$_item = merge($apt::proxy_defaults, $item)
229+
$_item = $apt::proxy_defaults + $item
230230
$_scheme = $_item['https'] ? {
231231
true => 'https',
232232
default => 'http',
@@ -239,17 +239,13 @@
239239
true => 'DIRECT',
240240
default => "${_scheme}://${_item['host']}${_port}/",
241241
}
242-
merge($item, {
243-
'scheme' => $_scheme,
244-
'target' => $_target,
245-
}
246-
)
242+
$item + { 'scheme' => $_scheme, 'target' => $_target, }
247243
}
248244
} else {
249245
$_perhost = {}
250246
}
251247

252-
$_proxy = merge($apt::proxy_defaults, $proxy, { 'perhost' => $_perhost })
248+
$_proxy = $apt::proxy_defaults + $proxy + { 'perhost' => $_perhost }
253249

254250
$confheadertmp = epp('apt/_conf_header.epp')
255251
$proxytmp = epp('apt/proxy.epp', { 'proxies' => $_proxy })

manifests/source.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
$_location = undef
115115
}
116116

117-
$includes = merge($apt::include_defaults, $include)
117+
$includes = $apt::include_defaults + $include
118118

119119
if $key and $keyring {
120120
fail('parameters key and keyring are mutualy exclusive')
@@ -125,7 +125,7 @@
125125
unless $key['id'] {
126126
fail('key hash must contain at least an id entry')
127127
}
128-
$_key = merge($apt::source_key_defaults, $key)
128+
$_key = $apt::source_key_defaults + $key
129129
} else {
130130
$_key = { 'id' => assert_type(String[1], $key) }
131131
}
@@ -164,7 +164,7 @@
164164

165165
if $pin {
166166
if $pin =~ Hash {
167-
$_pin = merge($pin, { 'ensure' => $ensure, 'before' => $_before })
167+
$_pin = $pin + { 'ensure' => $ensure, 'before' => $_before }
168168
} elsif ($pin =~ Numeric or $pin =~ String) {
169169
$url_split = split($location, '[:\/]+')
170170
$host = $url_split[1]

0 commit comments

Comments
 (0)