Merge lp:~jtv/maas-test/main-breakup into lp:maas-test
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Jeroen T. Vermeulen | ||||
Approved revision: | 117 | ||||
Merged at revision: | 117 | ||||
Proposed branch: | lp:~jtv/maas-test/main-breakup | ||||
Merge into: | lp:maas-test | ||||
Diff against target: |
137 lines (+84/-24) 1 file modified
maastest/main.py (+84/-24) |
||||
To merge this branch: | bzr merge lp:~jtv/maas-test/main-breakup | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+201148@code.launchpad.net |
Commit message
Break up main() a bit, make it testable, use exceptions sensibly.
Description of the change
This was getting to a size where carrying on Go-style was just not feasible any more.
I introduced a dedicated exception for "this is a mode of failure that we know can happen, and which should terminate the program in a known, managed, helpful way." I hope that was not presumptuous of me. If we wanted to get fancy, we might have exception classes for this instead of a return-codes enum, but that's not furthering the goal of this branch. The goal of this branch is to let me add yet another startup check without everything getting out of hand, and without unleashing sheer patching hell just to be able to exercise my new code in tests.
Jeroen