Skip to content
  • Thomas Bellman's avatar
    11b73c62
    resolve_ipnets(): Canonicalize numerical addresses again. · 11b73c62
    Thomas Bellman authored
    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.
    11b73c62
    resolve_ipnets(): Canonicalize numerical addresses again.
    Thomas Bellman authored
    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.
Loading