From abbf2129a17f403a91cbcb9f6bb5f7eaa2b173e7 Mon Sep 17 00:00:00 2001 From: Khai Do Date: Mon, 16 May 2016 16:34:24 -0700 Subject: [PATCH] Fix gerrit plugin installation The current test to only check for the existance of a plugin file doesn't work on update scenarios. The file already exists so it won't run the install. Instead we should download the file if it doesn't already exist and then install after download. This should install a plugins in 2 cases: 1. install plugin if there isn't already one in place 2. install an updated plugin if a new version of the plugin has been downloaded Change-Id: I2422c465011da4500abc9c7d1ae5273c6e5f628a --- manifests/plugin.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 3972346..f1e42f9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -68,11 +68,11 @@ define gerrit::plugin( } exec { "install-${base_plugin}": - command => "cp ${plugin_cache_dir}/${plugin} ${plugin_dir}/${base_plugin}", - path => ['/bin','/usr/bin', '/usr/sbin', '/usr/local/bin'], - require => Exec["download-${plugin}"], - user => 'gerrit2', - unless => "test -f ${plugin_dir}/${base_plugin}", + command => "cp ${plugin_cache_dir}/${plugin} ${plugin_dir}/${base_plugin}", + path => ['/bin','/usr/bin', '/usr/sbin', '/usr/local/bin'], + subscribe => Exec["download-${plugin}"], + user => 'gerrit2', + refreshonly => true, } }