Ottomata has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/214420

Change subject: Reverting some changes that broke diamond in labs
......................................................................

Reverting some changes that broke diamond in labs

Change-Id: Ie0d7b096e619564bbb4dd4bef617f984ef66601a
---
M modules/diamond/manifests/collector.pp
D modules/diamond/manifests/collector_module.pp
2 files changed, 18 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/214420/1

diff --git a/modules/diamond/manifests/collector.pp 
b/modules/diamond/manifests/collector.pp
index c4d4599..a590463 100644
--- a/modules/diamond/manifests/collector.pp
+++ b/modules/diamond/manifests/collector.pp
@@ -65,14 +65,25 @@
         notify  => Service['diamond'],
     }
 
-    # If this is a custom collector, use the collector_module class
-    # to install the custom python collector.
+    # Install a custom python collector.
     if $source {
-        class { '::diamond::collector_module':
-            ensure => $ensure,
-            name   => $name,
-            source => $source,
-            before => File["/etc/diamond/collectors/${collector}.conf"],
+        if !defined(File["/usr/share/diamond/collectors/${name}"]) {
+            file { "/usr/share/diamond/collectors/${name}":
+                ensure => ensure_directory($ensure),
+                owner  => 'root',
+                group  => 'root',
+                mode   => '0755',
+            }
+        }
+        if !defined(File["/usr/share/diamond/collectors/${name}/${name}.py"]) {
+            file { "/usr/share/diamond/collectors/${name}/${name}.py":
+                ensure => $ensure,
+                before => File["/etc/diamond/collectors/${collector}.conf"],
+                source => $source,
+                owner  => 'root',
+                group  => 'root',
+                mode   => '0644',
+            }
         }
     }
 }
diff --git a/modules/diamond/manifests/collector_module.pp 
b/modules/diamond/manifests/collector_module.pp
deleted file mode 100644
index 8858bc5..0000000
--- a/modules/diamond/manifests/collector_module.pp
+++ /dev/null
@@ -1,39 +0,0 @@
-# == Class diamond::collector_module
-# Installs a python diamond collector module.
-#
-# === Parameters
-# [*ensure*]
-#   Specifies whether or not this Diamond python module should exist.
-#   The default is 'present'.
-#
-# [*name*]
-#   The name of the collector class. The 'Collector' suffix may be
-#   omitted from the name.
-#
-# [*source*]
-#   A Puppet file reference to the Python collector source file.
-#
-class diamond::collector_module(
-    $ensure = 'present',
-    $name,
-    $source,
-) {
-    include ::diamond
-
-    validate_ensure($ensure)
-
-    file { "/usr/share/diamond/collectors/${name}":
-        ensure => ensure_directory($ensure),
-        owner  => 'root',
-        group  => 'root',
-        mode   => '0755',
-    }
-
-    file { "/usr/share/diamond/collectors/${name}/${name}.py":
-        ensure => $ensure,
-        source => $source,
-        owner  => 'root',
-        group  => 'root',
-        mode   => '0644',
-    }
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/214420
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0d7b096e619564bbb4dd4bef617f984ef66601a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to