Skip to content
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

Merged
merged 1 commit into from
Jan 25, 2017
Merged

Fixes #18070 - add_record() checks for conflicts with leases now. #498

merged 1 commit into from
Jan 25, 2017

Conversation

dmitri-d
Copy link
Member

No description provided.

@dmitri-d
Copy link
Member Author

@timogoebel: updated add_record to check for conflicts with leases.

@dmitri-d
Copy link
Member Author

[test]

1 similar comment
@dmitri-d
Copy link
Member Author

[test]

Copy link
Member

@timogoebel timogoebel left a 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}"
Copy link
Member

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
Copy link
Member

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]
Copy link
Member

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?

@dmitri-d
Copy link
Member Author

Copy link
Member

@timogoebel timogoebel left a 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.

@timogoebel timogoebel merged commit 72fd048 into theforeman:develop Jan 25, 2017
@dmitri-d dmitri-d deleted the 18070-dhcp-add-record-ip-check branch January 25, 2017 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants