Skip to content

Commit 405f122

Browse files
committed
DRY backends.pp to avoide lint warning
1 parent f2f8e8d commit 405f122

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

manifests/backends.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# == Class: statsd::backends
22
class statsd::backends {
33
$backends = join($statsd::backends, ',')
4+
$node_base = "${statsd::node_module_dir}/statsd/node_modules"
45

56
# Make sure $statsd::influxdb_host is set
67
if $backends =~ /influxdb/ {
78
exec { 'install-statsd-influxdb-backend':
89
command => '/usr/bin/npm install --save statsd-influxdb-backend',
910
cwd => "${statsd::node_module_dir}/statsd",
10-
unless => "/usr/bin/test -d ${statsd::node_module_dir}/statsd/node_modules/statsd-influxdb-backend",
11+
unless => "/usr/bin/test -d ${node_base}/statsd-influxdb-backend",
1112
require => Package['statsd'],
1213
}
1314
}
@@ -17,7 +18,7 @@
1718
exec { 'install-statsd-librato-backend':
1819
command => '/usr/bin/npm install --save statsd-librato-backend',
1920
cwd => "${statsd::node_module_dir}/statsd",
20-
unless => "/usr/bin/test -d ${statsd::node_module_dir}/statsd/node_modules/statsd-librato-backend",
21+
unless => "/usr/bin/test -d ${node_base}/statsd-librato-backend",
2122
require => Package['statsd'],
2223
}
2324
}
@@ -27,7 +28,7 @@
2728
exec { 'install-statsd-stackdriver-backend':
2829
command => '/usr/bin/npm install --save stackdriver-statsd-backend',
2930
cwd => "${statsd::node_module_dir}/statsd",
30-
unless => "/usr/bin/test -d ${statsd::node_module_dir}/statsd/node_modules/stackdriver-statsd-backend",
31+
unless => "/usr/bin/test -d ${node_base}/stackdriver-statsd-backend",
3132
require => Package['statsd'],
3233
}
3334
}

0 commit comments

Comments
 (0)