Skip to content

Commit 9f20b7f

Browse files
authored
Merge pull request #234 from bastelfreak/puppet-lint-top_scope_facts-check
puppet-lint: fix top_scope_facts warnings
2 parents a00138f + 3ce83fa commit 9f20b7f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

manifests/peer.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
if $fqdn != $facts['networking']['fqdn'] {
4848
# and we don't want to attach a server that is already a member
4949
# of the current pool
50-
if getvar('::gluster_peer_list') {
51-
$peers = split($::gluster_peer_list, ',' )
50+
if $facts['gluster_peer_list'] {
51+
$peers = split($facts['gluster_peer_list'], ',' )
5252
if ! member($peers, $title) {
5353
$already_in_pool = false
5454
} else {
@@ -59,7 +59,7 @@
5959
}
6060
if !$already_in_pool {
6161
exec { "gluster peer probe ${title}":
62-
command => "${::gluster_binary} peer probe ${title}",
62+
command => "${facts['gluster_binary']} peer probe ${title}",
6363
}
6464
}
6565
}

manifests/volume.pp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
if getvar('::gluster_binary') {
105105
# we need the Gluster binary to do anything!
106106

107-
if getvar('::gluster_volume_list') and member( split( $::gluster_volume_list, ',' ), $title ) {
107+
if $facts['gluster_volume_list'] and member( split( $facts['gluster_volume_list'], ',' ), $title ) {
108108
$already_exists = true
109109
} else {
110110
$already_exists = false
@@ -116,7 +116,7 @@
116116
# nothing to do if volume does not exist and it should be absent
117117
if $ensure == 'present' {
118118
exec { "gluster create volume ${title}":
119-
command => "${::gluster_binary} volume create ${title} ${args}",
119+
command => "${facts['gluster_binary']} volume create ${title} ${args}",
120120
}
121121

122122
# if we have volume options, activate them now
@@ -153,7 +153,7 @@
153153

154154
# don't forget to start the new volume!
155155
exec { "gluster start volume ${title}":
156-
command => "${::gluster_binary} volume start ${title}",
156+
command => "${facts['gluster_binary']} volume start ${title}",
157157
require => Exec["gluster create volume ${title}"],
158158
}
159159
}
@@ -198,12 +198,12 @@
198198

199199
$new_bricks_list = join($new_bricks, ' ')
200200
exec { "gluster add bricks to ${title}":
201-
command => "${::gluster_binary} volume add-brick ${title} ${s} ${r} ${new_bricks_list} ${_force}",
201+
command => "${facts['gluster_binary']} volume add-brick ${title} ${s} ${r} ${new_bricks_list} ${_force}",
202202
}
203203

204204
if $rebalance {
205205
exec { "gluster rebalance ${title}":
206-
command => "${::gluster_binary} volume rebalance ${title} start",
206+
command => "${facts['gluster_binary']} volume rebalance ${title} start",
207207
require => Exec["gluster add bricks to ${title}"],
208208
}
209209
}
@@ -213,7 +213,7 @@
213213
# the self heal daemon comes back to life.
214214
# as such, we sleep 5 here before starting the heal
215215
exec { "gluster heal ${title}":
216-
command => "/bin/sleep 5; ${::gluster_binary} volume heal ${title} full",
216+
command => "/bin/sleep 5; ${facts['gluster_binary']} volume heal ${title} full",
217217
require => Exec["gluster add bricks to ${title}"],
218218
}
219219
}
@@ -273,7 +273,7 @@
273273
} else {
274274
# stop and remove volume
275275
exec { "gluster stop and remove ${title}":
276-
command => "/bin/yes | ( ${::gluster_binary} volume stop ${title} force && ${::gluster_binary} volume delete ${title} )",
276+
command => "/bin/yes | ( ${facts['gluster_binary']} volume stop ${title} force && ${facts['gluster_binary']} volume delete ${title} )",
277277
}
278278
}
279279
}

0 commit comments

Comments
 (0)