-
Notifications
You must be signed in to change notification settings - Fork 217
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
Fixes #18070 - add_record() checks for conflicts with leases now. #498
Fixes #18070 - add_record() checks for conflicts with leases now. #498
Conversation
@timogoebel: updated add_record to check for conflicts with leases. |
[test] |
1 similar comment
[test] |
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.
@witlessbird : Thanks. I've left some inline comments!
unless similar_records.empty? | ||
logger.warn "Request to create a conflicting DHCP record" | ||
logger.debug "request: #{to_return.inspect}" | ||
logger.debug "existing: #{similar_records.inspect}" |
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.
Too many whitespaces between :
and #
end | ||
true | ||
def ==(other) | ||
ip == other.ip && mac == other.mac && subnet == other.subnet && deleteable? == other.deleteable? && options == other.options |
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.
Should we check if other is really a record before comparison? Same for Proxy::DHCP::Lease
.
|
||
validate_ip(options[:ip]) | ||
validate_mac(options[:mac]) | ||
raise(Proxy::DHCP::Error, "Must provide hostname") unless options[:hostname] |
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 this safe to remove because we use "name" as a fallback? Should we add a check if name is set?
|
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.
Looks good and works great, thanks @witlessbird.
No description provided.