maas-import-pxe-files fails when run from the command line

Bug #1322606 reported by Graham Binns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Graham Binns

Bug Description

Running maas-import-pxe-files from the commandline results in an immediate error:

graham@angua: maas$ bin/py scripts/maas-import-pxe-files --config-file etc/maas/bootresources.yaml
2014-05-23 13:39:52,892 ERROR Unhandled exception; unable to continue.
Traceback (most recent call last):
  File "scripts/maas-import-pxe-files", line 31, in <module>
    main(args)
  File "/home/graham/workspace/maas-work/maas/src/provisioningserver/import_images/boot_resources.py", line 261, in main
    if args.config:
AttributeError: 'Namespace' object has no attribute 'config'

This is because the script is looking for a "config" blob in the arguments to main, but none exists. Nor is it specified that it *could* exist. This looks like a combination of tests not testing the script from end-to-end (nothing tests scripts/maas-import-pxe-files directly; the highest level that tests get to is main()), a piece of missed coding and a test that mocks the config setup so that an appropriate failure never gets raised.

The script doesn't actually need to accept the config blob anymore – that code is a vestigial thinko from the first work to remove bootresources.yaml. It's easiest to just remove that check for args.config and the associated tests.

Related branches

Changed in maas:
status: In Progress → Fix Committed
milestone: none → 1.6.0
Changed in maas:
status: Fix Committed → Fix Released
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.