Skip to content

Commit

Permalink
allow setting IP from source
Browse files Browse the repository at this point in the history
sql/csv can now set IP as well as name, useful if you don't have FQDN.
If IP is given, then we don't try to resolve name.

closes #78
  • Loading branch information
ytti committed Feb 21, 2015
1 parent 1a9a814 commit 61c128c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 0.3.1
- FEATURE: allow setting IP address in addition to name in source (SQL/CSV)
- BUGFIX: xos while using telnet (by @fhibler)
- BUGFIX: ironware logout on some models (by @fhibler)

Expand Down
3 changes: 2 additions & 1 deletion lib/oxidized/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class Node
alias :running? :running
def initialize opt
@name = opt[:name]
@ip = Resolv.getaddress @name
@ip = IPAddr.new(opt[:ip]).to_s rescue nil
@ip ||= Resolv.getaddress @name
@group = opt[:group]
@input = resolve_input opt
@output = resolve_output opt
Expand Down

0 comments on commit 61c128c

Please sign in to comment.