Merge lp:~allenap/maas/service-monitor-any-state-2 into lp:~maas-committers/maas/trunk

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 5272
Proposed branch: lp:~allenap/maas/service-monitor-any-state-2
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 19 lines (+2/-0)
1 file modified
src/provisioningserver/utils/service_monitor.py (+2/-0)
To merge this branch: bzr merge lp:~allenap/maas/service-monitor-any-state-2
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+303298@code.launchpad.net

Commit message

Check types in ServiceState.__new__.

Requested in review for lp:~allenap/maas/service-monitor-any-state.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/utils/service_monitor.py'
2--- src/provisioningserver/utils/service_monitor.py 2016-08-18 15:21:07 +0000
3+++ src/provisioningserver/utils/service_monitor.py 2016-08-18 15:49:46 +0000
4@@ -26,6 +26,7 @@
5 import enum
6
7 from provisioningserver.logger.log import get_maas_logger
8+from provisioningserver.utils import typed
9 from provisioningserver.utils.shell import select_c_utf8_bytes_locale
10 from provisioningserver.utils.twisted import asynchronous
11 from twisted.internet.defer import (
12@@ -86,6 +87,7 @@
13
14 __slots__ = ()
15
16+ @typed
17 def __new__(cls, active_state: SERVICE_STATE=None, process_state=None):
18 if active_state is None:
19 active_state = SERVICE_STATE.UNKNOWN