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 3b5f48f..002a51e 100644 --- a/spec/foreman/export/runit_spec.rb +++ b/spec/foreman/export/runit_spec.rb @@ -33,4 +33,8 @@ describe Foreman::Export::Runit, :fakefs do example_export_file('runit/app-bravo-1-log-run') File.read("/tmp/init/app-bravo-1/env/PORT").should == "5100\n" end + + 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