Bug 1477149 - rhn-profile-sync stores incorrect ipv6 network mask in hardware profile and raises ValueError on F26
rhn-profile-sync stores incorrect ipv6 network mask in hardware profile and r...
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Gennadii Altukhov
Red Hat Satellite QA List
: 1477604 (view as bug list)
Depends On:
Blocks: spacewalk-review space27
  Show dependency treegraph
Reported: 2017-08-01 06:53 EDT by Ales Dujicek
Modified: 2017-09-27 15:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-09-27 15:37:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ales Dujicek 2017-08-01 06:53:16 EDT
Description of problem:

I added some ipv6 addresses with custom masks to a network interface
# ip a
    inet6 b023::75/75 scope global 
       valid_lft forever preferred_lft forever
    inet6 b023::71/71 scope global 
       valid_lft forever preferred_lft forever

but after profile sync it has wrong netmasks in its profile:
# rhn-profile-sync 

System > Details > Hardware
Interface	IPv6 Address	Netmask
ens3	b023::71	73
ens3	b023::75	69

and on Fedora 26 rhn-profile-sync does not work because netifaces output has changed
>>> import netifaces
>>> interfaces = netifaces.interfaces()
>>> for interface in interfaces:
...   netifaces.ifaddresses(interface)[netifaces.AF_INET6]
[{'addr': '::1', 'netmask': 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'}]
[{'addr': '2620:52:0:2224:5054:ff:fe87:ced6', 'netmask': 'ffff:ffff:ffff:ffff::/64'}, {'addr': 'fe80::5054:ff:fe87:ced6%ens3', 'netmask': 'ffff:ffff:ffff:ffff::/64'}]

# rhn-profile-sync 
Updating package profile...
Updating hardware profile...
Error reading network interface information: <class 'ValueError'>

Traceback (most recent call last):
  File "/usr/sbin/rhn-profile-sync", line 59, in <module>
  File "/usr/share/rhn/up2date_client/rhncli.py", line 96, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhn-profile-sync", line 50, in main
  File "/usr/share/rhn/up2date_client/rhnHardware.py", line 10, in updateHardware
    hardwareList = hardware.Hardware()
  File "/usr/share/rhn/up2date_client/hardware.py", line 941, in Hardware
    ret = read_network_interfaces()
  File "/usr/share/rhn/up2date_client/hardware.py", line 741, in read_network_interfaces
    netmask_bits += 16 - 1 - bin(int(two_octets, 16))[2:].rindex('1')
<class 'ValueError'>: invalid literal for int() with base 16: 'ffff/128'

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

How reproducible:

Steps to Reproduce:
1. add ipv6 address with custom mask
2. rhn-profile-sync
3. check System > Details > Hardware
Comment 1 Ales Dujicek 2017-08-01 06:57:38 EDT
pull request with fix
Comment 2 Gennadii Altukhov 2017-08-02 05:52:31 EDT
The bug is fixed in upstream. spacewalk.git:
Comment 3 Tomáš Kašpárek 2017-08-04 04:53:12 EDT
*** Bug 1477604 has been marked as a duplicate of this bug. ***
Comment 4 Eric Herget 2017-09-27 15:37:03 EDT
Spacewalk 2.7 has been released.


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