Akosiaris has submitted this change and it was merged.

Change subject: Use generic Rakefile in nrpe module
......................................................................


Use generic Rakefile in nrpe module

This makes the Rakefile used to run rspec-puppet tests in nrpe module
fully generic some it can be re-used as is in any other module

Change-Id: I3c97fcc849ba3d38044b6c3c8656f31f08d40f39
---
M modules/nrpe/Rakefile
1 file changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Akosiaris: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/nrpe/Rakefile b/modules/nrpe/Rakefile
index ed517ca..d9226a8 100644
--- a/modules/nrpe/Rakefile
+++ b/modules/nrpe/Rakefile
@@ -3,14 +3,16 @@
 
 require 'rspec/core/rake_task'
 
-symlinks = { 'spec/fixtures/modules/nrpe/files' => '../../../../files',
-  'spec/fixtures/modules/nrpe/manifests' => '../../../../manifests',
-  'spec/fixtures/modules/nrpe/templates' => '../../../../templates',
+modulename = File.basename(File.expand_path(File.dirname(__FILE__)))
+
+symlinks = { 'spec/fixtures/modules/%s/files' % modulename => 
'../../../../files',
+  'spec/fixtures/modules/%s/manifests' % modulename => '../../../../manifests',
+  'spec/fixtures/modules/%s/templates' % modulename => '../../../../templates',
 }
 
 
 task :setup do
-  FileUtils.mkdir_p('spec/fixtures/modules/nrpe')
+  FileUtils.mkdir_p('spec/fixtures/modules/%s' % modulename)
   symlinks.each do |x|
     if !File.exist?(x[0])
       FileUtils.ln_s(x[1], x[0])
@@ -20,7 +22,7 @@
 
 task :teardown do
   symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
-  FileUtils.rmdir('spec/fixtures/modules/nrpe')
+  FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
   FileUtils.rmdir('spec/fixtures/modules')
 end
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c97fcc849ba3d38044b6c3c8656f31f08d40f39
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Akosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Akosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to