Skip to content
Snippets Groups Projects
Commit 11b73c62 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

resolve_ipnets(): Canonicalize numerical addresses again.

When we started special casing numerical IP addresses to avoid doing
reverse lookups of them back in September 2015 (commit 97b58b8801), we
inadvertently stopped canonicalizing their textual representation, and
would just return whatever we got unchanged.  Restore canonicalization
by calling the #to_s() method on the IPAddr instance we just created,
and returning that.

We also explicitly handle an error case where IPAddr.new does not
raise an exception, but instead returns an IPAddr instance that is
not usable.  This happens at least when you manage to pass nil for
the family argument (which we should never do, but bugs happen).

This was originally commit 7539c236ed4e in nsc-puppet-utils.
parent c3bd97b2
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment