Merge lp:~rvb/maas/reporting-bug-1301809 into lp:~maas-committers/maas/trunk
Proposed by
Raphaël Badin
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Raphaël Badin | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2224 | ||||
Proposed branch: | lp:~rvb/maas/reporting-bug-1301809 | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
79 lines (+28/-1) 2 files modified
src/provisioningserver/boot/tests/test_tftppath.py (+13/-0) src/provisioningserver/boot/tftppath.py (+15/-1) |
||||
To merge this branch: | bzr merge lp:~rvb/maas/reporting-bug-1301809 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Review via email: mp+213984@code.launchpad.net |
Commit message
Change list_boot_images() so that it can cope with a missing boot images directory: this happens if the reporting task runs before the images have been imported.
To post a comment you must log in.
That's a nice touch — it fixes an unforeseen consequence of the TFTP root moving to a new directory hierarchy.
The comment on the new code reads a bit weird:
# Return an empty list only if the exception is a "No such file
# or directory" exception.
Which is the main new fact in that sentence — that we should return an empty list, or that sometimes we shouldn't return an empty list? I think it might come out clearer as a matter of course if you commented on the two possible cases _inside_ the if/else bodies: “Directory does not exist, so return empty list.” / “Other error. Propagate.”
Right below that, the log message seems useful, but unnecessarily verbose for its context. This is an automatically repeating job, not something that ever happens in response to a human interaction. We already have helpful messages in the UI for the situation it signals. If a user is savvy enough to operate without ever looking at the UI even when things aren't working, then I think we can expect them to understand a much terser message such as “No boot images have been imported yet.”
Keeping the message short helps keep the log files readable. The message is likely to be logged many times before the images have been imported, and even while they are importing. Also, if a user does see the repeating “push the import button!” message at that stage, they might misinterpret it as meaning that the original import didn't work and they need to start a new one.