-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Please ignore this patch. Usual malfunction of git send-email :-)
-- Michal mfoj...@redhat.com wrote: > From: Michal Fojtik <mfoj...@redhat.com> > > > Signed-off-by: Michal fojtik <mfoj...@redhat.com> --- server/Rakefile > | 13 +++++++++---- > server/lib/deltacloud/drivers/mock/mock_driver.rb | 2 +- 2 files > changed, 10 insertions(+), 5 deletions(-) > > diff --git a/server/Rakefile b/server/Rakefile index f07a6ce..e8b2f03 > 100644 --- a/server/Rakefile +++ b/server/Rakefile @@ -129,13 +129,18 > @@ namespace :mock do if ENV["DELTACLOUD_MOCK_STORAGE"] storage_root > = ENV["DELTACLOUD_MOCK_STORAGE"] elsif ENV["USER"] - > storage_root = File::join("/var/tmp", > "deltacloud-mock-#{ENV["USER"]}") + storage_root = > File::join("/var/lib/deltacloud", "deltacloud-mock-#{ENV["USER"]}") > else raise "Please set either the DELTACLOUD_MOCK_STORAGE or USER > environment variable" end data = > Dir::glob(File::join(File::dirname(__FILE__), "lib", "deltacloud", > "drivers", "mock", "data", "*")) - > FileUtils::mkdir_p(storage_root, :verbose => true) - > FileUtils::cp_r(data, storage_root, :verbose => true) + begin + > FileUtils::mkdir_p(storage_root, :verbose => true) + > FileUtils::cp_r(data, storage_root, :verbose => true) + rescue > Errno::EACCES + puts "\nERROR: Please create the > '/var/lib/deltacloud' directory manually and ensure that the current > user has write permissions on it.\n" + puts "TIP: You can set > the DELTACLOUD_MOCK_STORAGE environment variable to overide the > default location.\n\n" + end end > > desc "Remove Mock driver fixtures" @@ -143,7 +148,7 @@ namespace > :mock do if ENV["DELTACLOUD_MOCK_STORAGE"] storage_root = > ENV["DELTACLOUD_MOCK_STORAGE"] elsif ENV["USER"] - > storage_root = File::join("/var/tmp", > "deltacloud-mock-#{ENV["USER"]}") + storage_root = > File::join("/var/lib/deltacloud", "deltacloud-mock-#{ENV["USER"]}") > else raise "Please set either the DELTACLOUD_MOCK_STORAGE or USER > environment variable" end diff --git > a/server/lib/deltacloud/drivers/mock/mock_driver.rb > b/server/lib/deltacloud/drivers/mock/mock_driver.rb index > 29d18ef..a5f6ff1 100644 --- > a/server/lib/deltacloud/drivers/mock/mock_driver.rb +++ > b/server/lib/deltacloud/drivers/mock/mock_driver.rb @@ -91,7 +91,7 @@ > module Deltacloud::Drivers::Mock if ENV["DELTACLOUD_MOCK_STORAGE"] > storage_root = ENV["DELTACLOUD_MOCK_STORAGE"] elsif ENV["USER"] - > storage_root = File::join("/var/tmp", > "deltacloud-mock-#{ENV["USER"]}") + storage_root = > File::join("/var/lib/deltacloud", "deltacloud-mock-#{ENV["USER"]}") > else raise "Please set either the DELTACLOUD_MOCK_STORAGE or USER > environment variable" end - -- - -- Michal Fojtik, mfoj...@redhat.com Deltacloud API: http://deltacloud.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOt9IQAAoJEEnFpmY+LvFRlmwH/29n+poz3ZpW/zJxEVbaBSDH 8RGOXv9+zs4R4WeelFnXWtMqgVbfRiihNabzR4RwDP+PYsiDbolekYApIhsR6QpB P8cnCiySrXwmTsaH/GwLUSrPoCfjnFQ1rfoD52BMiScEaXi8Yx9RAeGynfXdpSd6 DS3n42JQoTHScCX5dZIzDzUPiH4y1HHapWwKUGyhZYjTt+6vBp9j4dlpj21UvWrj nq5V/wCXnEoynPOQtdW9LOD5JAXFYgX5W++W+a6TIiibUf+P3JmJfWJAsrs07AlO DLAintxy+cY/83Y26jfxTGxAuk2VhObWlb+0173txAzvVnroi3GIrYxu1Aq3u14= =hzAZ -----END PGP SIGNATURE-----