Bug 1568872 - python-netaddr: method IPAddress.netmask_bits() removed
Summary: python-netaddr: method IPAddress.netmask_bits() removed
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-netaddr
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: François Cami
QA Contact: Kaleem
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-18 10:55 UTC by Mauro Oddi
Modified: 2020-02-14 14:21 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-14 14:21:35 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github https://github.com/drkjam netaddr issues 38 0 None None None 2020-03-17 05:57:18 UTC
Red Hat Knowledge Base (Solution) 3416891 0 None None None 2018-04-18 10:56:55 UTC

Description Mauro Oddi 2018-04-18 10:55:33 UTC
Description of problem:
In the latest version of the python-netaddr library in RHEL the method IPAddress.netmask_bits() is not present, while in upstream version the method is available.

In the upstream changelog it is mentioned that the method was removed accidentally and re-added in version 0.7.11:

 - https://github.com/drkjam/netaddr/issues/38
 - http://netaddr.readthedocs.io/en/latest/changes.html#release-0-7-11

Link to the API:
 - https://netaddr.readthedocs.io/en/latest/api.html#netaddr.IPAddress.netmask_bits



Version-Release number of selected component (if applicable):
latest

How reproducible:
Always

Steps to Reproduce:
1. Install latest python-netaddr

# rpm -q  python-netaddr
python-netaddr-0.7.5-9.el7.noarch


2. Attempt to use method IPAddress.netmask_bits()

# python
Python 2.7.5 (default, May  3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netaddr
>>> ip = netaddr.IPAddress('1.1.1.1')
>>> ip
IPAddress('1.1.1.1')
>>> print ip
1.1.1.1
>>> dir(ip)
['__add__', '__and__', '__bool__', '__class__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__hex__', '__iadd__', '__index__', '__init__', '__int__', '__isub__', '__le__', '__long__', '__lshift__', '__lt__', '__module__', '__ne__', '__new__', '__nonzero__', '__oct__', '__or__', '__radd__', '__reduce__', '__reduce_ex__', '__repr__', '__rshift__', '__rsub__', '__setattr__', '__setstate__', '__sizeof__', '__slots__', '__str__', '__sub__', '__subclasshook__', '__xor__', '_module', '_set_value', '_value', 'bin', 'bits', 'format', 'info', 'ipv4', 'ipv6', 'is_hostmask', 'is_ipv4_compat', 'is_ipv4_mapped', 'is_link_local', 'is_loopback', 'is_multicast', 'is_netmask', 'is_private', 'is_reserved', 'is_unicast', 'key', 'packed', 'reverse_dns', 'sort_key', 'value', 'version', 'words']
>>> ip.netmask_bits()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'IPAddress' object has no attribute 'netmask_bits'
>>> q
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'q' is not defined
>>> quit()

3.

Actual results:


Expected results:


Additional info:

Comment 2 François Cami 2020-02-14 14:21:35 UTC
Fixing this bug was rejected for RHEL7. RHEL8 ships 0.7.19 which is not affected. Closing as WONTFIX.


Note You need to log in before you can comment on or make changes to this bug.