Skip to content

[BUG] netlab status fails if the server was rebooted #3217

@sdargoeuves

Description

@sdargoeuves

Describe the bug

If the server is rebooted (which often happens outside of my control), when I do netlab status I see this error:

╰─ dnetlab status 
Traceback (most recent call last):
  File "/home/seb/code/netlab/netlab/netlab", line 15, in <module>
    netsim.cli.lab_commands(__file__)
  File "/home/seb/code/netlab/netlab/netsim/cli/__init__.py", line 524, in lab_commands
    mod.run(sys.argv[arg_start:])   # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/seb/code/netlab/netlab/netsim/cli/status.py", line 374, in run
    show_lab(args,lab_states)
  File "/home/seb/code/netlab/netlab/netsim/cli/status.py", line 253, in show_lab
    fetch_node_status(lab_state,topology)
  File "/home/seb/code/netlab/netlab/netsim/cli/status.py", line 180, in fetch_node_status
    node_stat.status = wk_state.get('status','Unknown')
                       ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

To Reproduce

My topology file uses both provider libvirt and clab, and the multipass plugin.

Expected behavior

It should show me the state of the lab (which would be down as they don't survive a reboot)

Lab topology

---
message: "Extreme Lab!"

plugin: [ multilab ]
defaults.multilab.id: 3 # subnet will be 10.194.58.0/24
defaults.addressing.mgmt.start: 10

provider: clab

nodes:
  exos1:
    device: exos
    image: netlab/exos:32.7.2.19
    provider: libvirt

  exos2:
    device: exos
    image: vrnetlab/extreme_exos:32.7.2.19
    mtu: 1800
    provider: clab

links:
  - exos1:
    exos2:
  - exos1:
    exos2:
    name: "interEXOS - backup"

Version

  • dev

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions