New import script dumps traceback for any config file errors

Bug #1300879 reported by Graham Binns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Expired
High
Unassigned

Bug Description

If something essential is missing from its config file, the new import script errors thusly:

2014-04-01 17:17:37,019 ERROR Unhandled exception; unable to continue.
Traceback (most recent call last):
  File "/home/graham/workspace/maas-work/maas/scripts/maas-import-pxe-files", line 29, in <module>
    main(args)
  File "/home/graham/workspace/maas-work/maas/src/provisioningserver/import_images/boot_resources.py", line 485, in main
    repo_boot = dumper.dump(source['path'], keyring=source['keyring'])
  File "/home/graham/workspace/maas-work/maas/src/provisioningserver/import_images/boot_resources.py", line 264, in dump
    super(RepoDumper, self).sync(reader, rpath)
  File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 88, in sync
    return self.sync_index(reader, path, data, content)
  File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 240, in sync_index
    self.sync(reader, path=epath)
  File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 86, in sync
    return self.sync_products(reader, path, data, content)
  File "/usr/lib/python2.7/dist-packages/simplestreams/mirrors/__init__.py", line 318, in sync_products
    self.insert_item(item, src, target, pgree, ipath_cs)
  File "/home/graham/workspace/maas-work/maas/src/provisioningserver/import_images/boot_resources.py", line 277, in insert_item
    arch, subarches = item['arch'], item['subarches']
KeyError: u'subarches'

This is inelegant and unhelpful. It would be neater – and more useful – to say something like:

 "Missing required config item 'subarches'."

Bonus points for providing the user with a description of what the subarches config item should look like in an ideal world.

Tags: m-i-p-f
Revision history for this message
Julian Edwards (julian-edwards) wrote :

I could have sworn I already filed a bug and a kanban card for this, but I failed to find either.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Also it's not just missing config items, it's *any* parsing error on the config.

summary: - New import script doesn't handle missing config options elegantly
+ New import script dumps traceback for any config file errors
tags: added: m-i-p-f
Changed in maas:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for MAAS because there has been no activity for 60 days.]

Changed in maas:
status: Incomplete → Expired
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.