-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use Enum instead of validate_re for $sendfile #1664
Conversation
I don't see why the tests failed. |
parallel_tests maybe? 😹 |
@@ -636,7 +636,7 @@ | |||
it "should fail" do | |||
expect do | |||
catalogue | |||
end.to raise_error(Puppet::Error, /"foo" does not match/) | |||
end.to raise_error(Puppet::PreformattedError, /Evaluation Error: Error while evaluating a Resource Statement, Class\[Apache\]: parameter 'sendfile' expects a match for Enum\['Off', 'On', 'off', 'on'\], got 'foo'/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it still needed to test against those cases? In the Vox Pupuli namespace we dropped them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can delete this for sure, if wanted...
@@ -38,7 +38,7 @@ | |||
$purge_vhost_dir = undef, | |||
$purge_vdir = false, | |||
$serveradmin = 'root@localhost', | |||
$sendfile = 'On', | |||
Enum['On', 'Off', 'on', 'off'] $sendfile = 'On', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not map On/Off, on/off to bool in puppet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, overly complicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For simplification you could add a type Apache::OnOff
since this validation is used in a lot of places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that, if wanted.
However, that would be a separate PR, which also changes all occurrences of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right they shouldn't be in this PR.
@mmoll if you rebase, do the tests pass then? |
Tests are green now. |
anything needed to get this in? |
use Enum instead of validate_re for $sendfile
No description provided.