Antoni Segura Puimedon has posted comments on this change.
Change subject: netinfo: improve which ipv4 addr is reported if there are multiple
primary
......................................................................
Patch Set 1:
Manual verification:
In [4]: netinfo.get()['bridges']['ovirtmgmt']
Out[4]:
{'addr': '10.34.63.169', <-----------------------
'bootproto4': 'dhcp',
'cfg': {'BOOTPROTO': 'dhcp',
'DEFROUTE': 'yes',
'DELAY': '0',
'DEVICE': 'ovirtmgmt',
'HOTPLUG': 'no',
'MTU': '1500',
'NM_CONTROLLED': 'no',
'ONBOOT': 'yes',
'STP': 'off',
'TYPE': 'Bridge'},
'gateway': '10.34.63.254', <-----------------------
'ipv4addrs': ['10.34.63.169/22'], <-----------------------
'ipv6addrs': [],
'ipv6gateway': '::',
'mtu': '1500',
'netmask': '255.255.252.0', <-----------------------
...
Then on a separate terminal do:
dev-09 vdsm (b0dd8b0) # ip -4 a s dev ovirtmgmt
12: ovirtmgmt: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
group default
inet 10.34.63.169/22 brd 10.34.63.255 scope global dynamic ovirtmgmt
valid_lft 6303sec preferred_lft 6303sec
dev-09 vdsm (b0dd8b0) # ip -4 addr add 192.168.211.2/24 dev ovirtmgmt
dev-09 vdsm (b0dd8b0) # ip -4 a s dev ovirtmgmt
12: ovirtmgmt: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
group default
inet 10.34.63.169/22 brd 10.34.63.255 scope global dynamic ovirtmgmt
valid_lft 6266sec preferred_lft 6266sec
inet 192.168.211.2/24 scope global ovirtmgmt
valid_lft forever preferred_lft forever
And check what is reported now
In [5]: netinfo.get()['bridges']['ovirtmgmt']
Out[5]:
{'addr': '10.34.63.169', <-----------------------
'bootproto4': 'dhcp',
'cfg': {'BOOTPROTO': 'dhcp',
'DEFROUTE': 'yes',
'DELAY': '0',
'DEVICE': 'ovirtmgmt',
'HOTPLUG': 'no',
'MTU': '1500',
'NM_CONTROLLED': 'no',
'ONBOOT': 'yes',
'STP': 'off',
'TYPE': 'Bridge'},
'gateway': '10.34.63.254', <-----------------------
'ipv4addrs': ['10.34.63.169/22', '192.168.211.2/24'],
<-----------------------
'ipv6addrs': [],
'ipv6gateway': '::',
'mtu': '1500',
'netmask': '255.255.252.0', <-----------------------
As can be seen, the ip on the subnet of the gateway is still reported as 'addr'
--
To view, visit
http://gerrit.ovirt.org/33375
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8666cfef5bd8ea63edf8979e501d4785db5f4893
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No