From fca46d774f6b5b16b3f2f5201dcfc2905443af53 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 17 Nov 2014 15:35:37 -0500 Subject: [PATCH] Ensure we only define subunit worker packages once We can only declare the packages once per node, but since we spin up multiple workers per node, the definitions were being duplicated. This fixes the worker.pp file to ensure we only define packages once. Change-Id: Idc67f97b77b4f4be3864c9dacd3835bb8328d068 --- modules/subunit2sql/manifests/worker.pp | 38 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/modules/subunit2sql/manifests/worker.pp b/modules/subunit2sql/manifests/worker.pp index c7de964baa..7161b06cff 100644 --- a/modules/subunit2sql/manifests/worker.pp +++ b/modules/subunit2sql/manifests/worker.pp @@ -21,28 +21,38 @@ define subunit2sql::worker ( ) { $suffix = "-${name}" - package { 'python-daemon': - ensure => present, + if ! defined(Package['python-daemon']) { + package { 'python-daemon': + ensure => present, + } } - package { 'python-zmq': - ensure => present, + if ! defined(Package['python-zmq']) { + package { 'python-zmq': + ensure => present, + } } - package { 'python-yaml': - ensure => present, + if ! defined(Package['python-yaml']) { + package { 'python-yaml': + ensure => present, + } } - package { 'gear': - ensure => latest, - provider => 'pip', - require => Class['pip'], + if ! defined(Package['gear']) { + package { 'gear': + ensure => latest, + provider => 'pip', + require => Class['pip'], + } } - package { 'statsd': - ensure => latest, - provider => 'pip', - require => Class['pip'] + if ! defined(Package['statsd']) { + package { 'statsd': + ensure => latest, + provider => 'pip', + require => Class['pip'] + } } file { '/usr/local/bin/subunit-gearman-worker.py':