Skip to content

Commit

Permalink
Make params optional
Browse files Browse the repository at this point in the history
  • Loading branch information
damonmaria committed May 12, 2021
1 parent 31da180 commit 2c3760c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@
class domain (
$customer = if $trusted[domain] =~ /^([^.]+)\.([^.]+)\.lan$/ { $2 },
$site = if $trusted[domain] =~ /^([^.]+)\.([^.]+)\.lan$/ { $1 },
) {
if !$customer or !$site {
fail("Could not parse from (trusted) domain ${$trusted[domain]}, params must be provided explicitly")
}
}
) {}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mindhive-domain",
"version": "0.1.1",
"version": "0.1.2",
"author": "[email protected]",
"summary": "",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/domain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
context 'invalid domain' do
let(:node) { 'wrong.parse' }

it { is_expected.to compile.with_all_deps.and_raise_error(/Evaluation Error/) }
it { is_expected.to contain_class('domain').with({ 'customer' => nil, 'site' => nil }) }
end

end

0 comments on commit 2c3760c

Please sign in to comment.