BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400117 )

Change subject: npm: Add guard for Exec['downgrade_npm']
......................................................................

npm: Add guard for Exec['downgrade_npm']

Add an "unless" guard condition to keep the Exec['downgrade_npm']
resource from firing unnecessarily.

Change-Id: Ic3fd9518254cae379092f9650e596e1ba8292dfe
---
M puppet/modules/npm/manifests/init.pp
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/17/400117/1

diff --git a/puppet/modules/npm/manifests/init.pp 
b/puppet/modules/npm/manifests/init.pp
index dde3fdd..61482a9 100644
--- a/puppet/modules/npm/manifests/init.pp
+++ b/puppet/modules/npm/manifests/init.pp
@@ -43,13 +43,13 @@
 
     # Node 6 brings in npm 3 that doesn't work in shared folders due to a bug.
     # See: https://github.com/npm/npm/issues/9953
-    # Although the ticket is closed, the issue is still present, so downgrade 
to npm 2
+    # Although the ticket is closed, the issue is still present, so downgrade
+    # to the latest npm 2
     exec { 'downgrade_npm':
       command => '/usr/bin/npm install -g npm@latest-2',
       user    => 'root',
-      require => [
-          Package['nodejs'],
-      ],
+      unless  => '/usr/bin/npm --version | /bin/grep -qe ^2',
+      require => Package['nodejs'],
     }
 
     env::var { 'NPM_CONFIG_CACHE':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3fd9518254cae379092f9650e596e1ba8292dfe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

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

Reply via email to