From e76f3533dcaf0e610b935d7ea47c7a5799e7c97c Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Wed, 18 Jan 2012 20:13:08 -0700 Subject: [PATCH] runit creates a full path to export directory. --- lib/foreman/export/runit.rb | 2 +- spec/foreman/export/runit_spec.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/foreman/export/runit.rb b/lib/foreman/export/runit.rb index ac7dac7..b3c74cb 100644 --- a/lib/foreman/export/runit.rb +++ b/lib/foreman/export/runit.rb @@ -51,7 +51,7 @@ class Foreman::Export::Runit < Foreman::Export::Base private def create_directory(location) say "creating: #{location}" - FileUtils.mkdir(location) + FileUtils.mkdir_p(location) end def inline_variables(command) diff --git a/spec/foreman/export/runit_spec.rb b/spec/foreman/export/runit_spec.rb index d42fb5c..a844956 100644 --- a/spec/foreman/export/runit_spec.rb +++ b/spec/foreman/export/runit_spec.rb @@ -33,4 +33,8 @@ describe Foreman::Export::Runit do example_export_file('runit/app-bravo-1-log-run') File.read("/tmp/init/app-bravo-1/env/PORT").should == "5100\n" end -end \ No newline at end of file + + it "creates a full path to the export directory" do + expect { runit.export('/tmp/init', :concurrency => "alpha=2,bravo=1") }.to_not raise_error(Errno::ENOENT) + end +end