Skip to content

Commit

Permalink
Made manifest default to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Ratcliffe authored and dylanratcliffe committed Jan 26, 2021
1 parent 8ff57ee commit 56097ac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Onceover is a tool to automatically run basic tests on an entire Puppet control

It includes automatic parsing of the `Puppetfile`, `environment.conf` and others in order to stop silly mistakes ever reaching your Puppet Master!

**🍺🥳 New in v3.17.1: Heaps more Windows fixes! Windows code is now more likely to compile on Non-Windows.**
**New in v3.20.0: I've reversed the decision to have onceover use `site.pp` in the same way Puppet does. From now on your `manifest` setting in `environment.conf` will be ignored and your `site.pp` will only be used if you explicitly set the `manifest` option in the CLI or config file.**

[![Build Status](https://travis-ci.com/dylanratcliffe/onceover.svg?branch=master)](https://travis-ci.com/dylanratcliffe/onceover) [![Build status](https://ci.appveyor.com/api/projects/status/2ys2ggkgln69hmyf/branch/master?svg=true)](https://ci.appveyor.com/project/dylanratcliffe/onceover/branch/master)

Expand Down
2 changes: 1 addition & 1 deletion features/cache.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: Create and maintain a .onceover cache
Then the cache should exist
And the cache should contain all controlrepo files

Scenario: Runnone onnceover in the caching repo
Scenario: Run onceover in the caching repo
Given control repo "caching"
When I run onceover command "run spec --classes role::webserver"
Then I should not see any errors
Expand Down
9 changes: 7 additions & 2 deletions lib/onceover/controlrepo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,16 @@ def initialize(opts = {})
@profile_regex = opts[:profile_regex] ? Regexp.new(opts[:profile_regex]) : /profile[s]?:{2}/
@tempdir = opts[:tempdir] || File.expand_path('./.onceover', @root)
$temp_modulepath = nil
manifest = opts[:manifest] || config['manifest'] || 'manifests'
@manifest = File.expand_path(manifest, @root)
@opts = opts
logger.level = :debug if @opts[:debug]
@@existing_controlrepo = self

# Set the manifest option to the fully expanded path if it's used,
# default to nil
manifest = opts[:manifest] || config['manifest'] || nil
if manifest
@manifest = File.expand_path(manifest, @root)
end
end


Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/controlrepos/caching/manifests/site.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
# This is where you can declare classes for all nodes.
# Example:
# class { 'my_class': }
fail('This was using the manifest setting from environment.conf')
}

0 comments on commit 56097ac

Please sign in to comment.