Merge lp:~jtv/maas/register-mac-type into lp:~maas-committers/maas/trunk
Proposed by
Jeroen T. Vermeulen
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1575 |
Proposed branch: | lp:~jtv/maas/register-mac-type |
Merge into: | lp:~maas-committers/maas/trunk |
Prerequisite: | lp:~jtv/maas/router-macs |
Diff against target: |
118 lines (+23/-6) 4 files modified
src/maasserver/fields.py (+1/-5) src/maasserver/start_up.py (+5/-0) src/maasserver/testing/testcase.py (+6/-0) src/maasserver/tests/test_fields.py (+11/-1) |
To merge this branch: | bzr merge lp:~jtv/maas/register-mac-type |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+181723@code.launchpad.net |
Commit message
Register MAC type with psycopg during program startup, not while importing modules.
Description of the change
It's not appropriate for module-level code to attempt to connect the database. It's an uncontrolled environment, and lint checkers may exercise the code by accident.
I did not try this out with a packaged install (although the tests should ensure that that will work) because we don't have a package with the requisite "array" extension yet.
Jeroen
To post a comment you must log in.
review: approve
Looks good.