Skip to content

Commit

Permalink
Make sure spec_dir exists
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Jan 28, 2016
1 parent 6613a5d commit fb237b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puppet/indirector/report/rest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require 'serverspec'
require 'stringio'
require 'facter'
require 'fileutils'


module PuppetSpecReport
Expand All @@ -32,6 +33,7 @@ def save(request)
# TODO: Check that we get the catalog from cache
resources = Puppet::Resource::Catalog.indirection.find(request.instance.host).resources
spec_dir = File.join(Puppet[:vardir], 'policy', 'server')
FileUtils.mkdir_p(spec_dir)
Puppetx::Policy::AutoSpec.gen_auto_spec_files(resources, spec_dir)
Puppet.debug('Generated auto_spec files')

Expand Down

0 comments on commit fb237b7

Please sign in to comment.