From ac627bc98ab726499c948560aadc642c6e7cd691 Mon Sep 17 00:00:00 2001 From: Xand Meaden Date: Mon, 2 Mar 2020 10:32:15 +0000 Subject: [PATCH] Don't break OS python installation https://github.com/voxpupuli/puppet-collectd/issues/879 --- manifests/plugin/python.pp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/manifests/plugin/python.pp b/manifests/plugin/python.pp index 4487dd590..e044f1892 100644 --- a/manifests/plugin/python.pp +++ b/manifests/plugin/python.pp @@ -52,17 +52,19 @@ default => 'directory', } - ensure_resource('file', $module_dirs, - { - 'ensure' => $ensure_modulepath, - 'mode' => $collectd::plugin_conf_dir_mode, - 'owner' => $collectd::config_owner, - 'purge' => $collectd::purge_config, - 'force' => true, - 'group' => $collectd::config_group, - 'require' => Package[$collectd::package_name] - } - ) + if $module_dirs == $modulepaths { + ensure_resource('file', $module_dirs, + { + 'ensure' => $ensure_modulepath, + 'mode' => $collectd::plugin_conf_dir_mode, + 'owner' => $collectd::config_owner, + 'purge' => $collectd::purge_config, + 'force' => true, + 'group' => $collectd::config_group, + 'require' => Package[$collectd::package_name] + } + ) + } # should be loaded after global plugin configuration $python_conf = "${collectd::plugin_conf_dir}/${conf_name}"