landscape-sysinfo crashes if asked to use an unknown plugin

Bug #1754002 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
New
Undecided
Unassigned
landscape-client (Ubuntu)
Triaged
Low
Unassigned

Bug Description

$ landscape-sysinfo --sysinfo-plugins=Foobar
Traceback (most recent call last):
  File "/usr/bin/landscape-sysinfo", line 22, in <module>
    run(sys.argv[1:], reactor)
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 115, in run
    for plugin in config.get_plugins():
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 71, in get_plugins
    for plugin_name in plugins]
  File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 71, in <listcomp>
    for plugin_name in plugins]
  File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 173, in namedObject
    module = namedModule('.'.join(classSplit[:-1]))
  File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 159, in namedModule
    topLevel = __import__(name)
ModuleNotFoundError: No module named 'landscape.sysinfo.foobar'

The --exclude-sysinfo-plugins option works just fine with unknown plugins:
$ landscape-sysinfo --exclude-sysinfo-plugins=Foobar
  System load: 0.03 Processes: 81
  Usage of /home: 0.6% of 19.68GB Users logged in: 1
  Memory usage: 6% IP address for ens3: 192.168.122.47
  Swap usage: 0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

Changed in landscape-client (Ubuntu):
importance: Undecided → High
Changed in landscape-client (Ubuntu):
status: In Progress → Triaged
importance: High → Low
assignee: Andreas Hasenack (ahasenack) → nobody
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.