Skip to content

feature: support an IP Address provided with a netmask #690

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

Merged
merged 2 commits into from
Feb 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/oxidized/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ class Node
alias :running? :running
def initialize opt
Oxidized.logger.debug 'resolving DNS for %s...' % opt[:name]
# remove the prefix if an IP Address is provided with one as IPAddr converts it to a network address.
ip_addr, _ = opt[:ip].to_s.split("/")
Oxidized.logger.debug 'IPADDR %s' % ip_addr.to_s
@name = opt[:name]
@ip = IPAddr.new(opt[:ip]).to_s rescue nil
@ip = IPAddr.new(ip_addr).to_s rescue nil
@ip ||= Resolv.new.getaddress @name
@group = opt[:group]
@input = resolve_input opt
Expand Down