[labkey] d05-2 IP address is not access expectedly (IndexError: list index out of range)

Bug #1956349 reported by Taihsiang Ho
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
canonical-server-hwe-utils
New
Undecided
Unassigned

Bug Description

"labkey ssh d05-2" won't get a valid (not empty machine.boot_interface.links[1]) and raise Traceback[2].

Comparing to a valid connection, machine.boot_interface.links should have IP information:
>>> mm = labmaas.get_machine_by_hostname("segers")
>>> mm
<Machine hostname='segers' system_id='cre4mw'>
>>> machine
<Machine hostname='d05-2' system_id='78g4hm'>
>>> mm.boot_interface.links
<InterfaceLinks.Managed#Interface length=1 items=[<InterfaceLink ip_address='10.228.68.113' mode=<LinkMode.AUTO: 'auto'> subnet=<Subnet cidr='10.228.68.0/24' name='10.228.68.0/24' vlan=<Vlan name='untagged' vid=0>>>]>
>>> machine.boot_interface.links
<InterfaceLinks.Managed#Interface length=0 items=[]>

[1] length of machine.boot_interface.links is 0:
>>> machine.boot_interface.links

<InterfaceLinks.Managed#Interface length=0 items=[]>

[2] Traceback:

$ labkey ssh d05-2
Launching labkey...
pipenv run ./labkey ssh d05-2
Traceback (most recent call last):
  File "./labkey", line 401, in <module>
    m.ssh()
  File "./labkey", line 309, in ssh
    ip = machine.boot_interface.links[0].ip_address
  File "/home/tai271828/.local/share/virtualenvs/canonical-server-hwe-utils-q1W0WnoQ/lib/python3.8/site-packages/maas/client/viscera/__init__.py", line 566, in __getitem__
    return self._items[spec]
IndexError: list index out of range
labkey completed.

Revision history for this message
Taihsiang Ho (tai271828) wrote :

If we check the web UI page of d05-2 network[1], its default type of the default connection interface is "Bridge" instead of "Physical". My gut feeling shows this is the root cause: labkey currently only parse the information of physical NIC.

I am not sure if the bridge setup of d05-2 is on purpose or not. Let' aligned the configuration in Friday's meeting if no further response from the team internally.

[1] d05-2 network maas web page http://10.228.68.5:5240/MAAS/l/machine/78g4hm?area=network

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.