From 9c29cae7afde38580177541aceca4802f7c3b17c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 11 Aug 2009 11:12:17 +0200 Subject: [PATCH] Copy contents of directory 'default' to all guests. --- testing/config/default.yml | 3 ++- testing/lib/guest_config.rb | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/testing/config/default.yml b/testing/config/default.yml index 0e28ca9263..9f8814c038 100644 --- a/testing/config/default.yml +++ b/testing/config/default.yml @@ -34,7 +34,8 @@ # | |-master - the master file system to be used (folder or tarball) # | |-templates - default config files etc. that are copied to the guests root # | | file system. a directory with the guest's name must exist in -# | | the directory specified here. +# | | the directory specified here. the contents of a subdirectory +# | | named 'default' are copied to all guests. # | |-mem - the memory in MB per guest # | |-console - a list of consoles to be connected for the guests (xterm|pts). # | e.g. diff --git a/testing/lib/guest_config.rb b/testing/lib/guest_config.rb index 6e2be97d26..add991cf99 100644 --- a/testing/lib/guest_config.rb +++ b/testing/lib/guest_config.rb @@ -65,10 +65,12 @@ module Dumm @root = File.join(Testing.guests_dir, name, 'diff') if @templates - tmpl = File.join(@templates, name) - if File.directory?(tmpl) - # '/.' is required to copy the contents of tmpl and not tmpl itself - FileUtils.cp_r(tmpl + '/.', @root) + ['default', name].each do |dir| + tmpl = File.join(@templates, dir) + if File.directory?(tmpl) + # '/.' is required to copy the contents of tmpl and not tmpl itself + FileUtils.cp_r(tmpl + '/.', @root) + end end end -- 2.47.2