-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
allow dhcp::host to set "on EVENT" handlers #216
Conversation
manifests/host.pp
Outdated
@@ -7,6 +7,9 @@ | |||
Hash $options = {}, | |||
String $comment ='', | |||
Boolean $ignored = false, | |||
Optional[Array[String]] $on_commit = undef, |
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.
Please align the =
and enforce the minimal string length:
Optional[Array[String]] $on_commit = undef, | |
Optional[Array[String[1]]] $on_commit = undef, |
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.
Good call on this one. Update coming...
manifests/host.pp
Outdated
Boolean $ignored = false, | ||
Optional[Integer] $default_lease_time = undef, | ||
Optional[Integer] $max_lease_time = undef, | ||
Optional[Array[String[1]]] $on_commit = undef, |
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.
ah crap, I was a bit blind when I reviewed this the last time. For array we try to default to empty arrays instead of making them optional. From our review guidelines:
Are there new params with datatype Hash or Array? If possible, they should default to empty Hash/Array instead of undef. You can also enforce the datastructure like Array[String[1]]
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.
It'd be nice if the tests caught this. I honestly don't see what difference it makes, but a fix is in the works if it makes this project happy. IMHO, I think undef
is far more appropriate to mean "not set", but that's me.
ece9e95
to
a88dc6f
Compare
This adds 3 new optional parameters to dhcp::host: * on_commit * on_release * on_expiry Each of these accepts an array of strings representing statements that dhcpd is to perform when that event occurs for that host. Signed-off-by: John Florian <jflorian@doubledog.org>
a88dc6f
to
616f160
Compare
thanks @jflorian ! |
Pull Request (PR) description
This adds 3 new optional parameters to
dhcp::host
:on_commit
on_release
on_expiry
Each of these accepts an array of strings representing statements that dhcpd is to perform when that event occurs for that host.
Signed-off-by: John Florian jflorian@doubledog.org
This Pull Request (PR) fixes the following issues
none have been created