Merge lp:~newell-jensen/maas/fix-1592885 into lp:maas/trunk

Proposed by Newell Jensen on 2016-06-21
Status: Merged
Approved by: Newell Jensen on 2016-06-22
Approved revision: 5139
Merged at revision: 5139
Proposed branch: lp:~newell-jensen/maas/fix-1592885
Merge into: lp:maas/trunk
Diff against target: 54 lines (+12/-1)
2 files modified
src/provisioningserver/plugin.py (+6/-0)
src/provisioningserver/tests/test_plugin.py (+6/-1)
To merge this branch: bzr merge lp:~newell-jensen/maas/fix-1592885
Reviewer Review Type Date Requested Status
Gavin Panella (community) 2016-06-21 Approve on 2016-06-22
Review via email: mp+298070@code.launchpad.net

Commit message

The region service is using logger.basicConfig for setting the log messags. This branch updates the rack service to use the same setup as the region service so that we can get consistent messaging between the two.

To post a comment you must log in.
Newell Jensen (newell-jensen) wrote :

Since maas.log is generated from syslog, we are leaving that one as it currently is.

Gavin Panella (allenap) wrote :

Tip top!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/plugin.py'
2--- src/provisioningserver/plugin.py 2016-06-03 17:34:13 +0000
3+++ src/provisioningserver/plugin.py 2016-06-21 21:29:22 +0000
4@@ -170,12 +170,18 @@
5 import crochet
6 crochet.no_setup()
7
8+ def _configureLogging(self):
9+ # Get something going with the logs.
10+ from provisioningserver import logger
11+ logger.basicConfig()
12+
13 def makeService(self, options):
14 """Construct the MAAS Cluster service."""
15 register_sigusr2_thread_dump_handler()
16 add_term_error_code_to_tftp()
17
18 self._configureCrochet()
19+ self._configureLogging()
20
21 with ClusterConfiguration.open() as config:
22 tftp_root = config.tftp_root
23
24=== modified file 'src/provisioningserver/tests/test_plugin.py'
25--- src/provisioningserver/tests/test_plugin.py 2016-06-03 17:34:13 +0000
26+++ src/provisioningserver/tests/test_plugin.py 2016-06-21 21:29:22 +0000
27@@ -12,7 +12,10 @@
28 MAASTwistedRunTest,
29 )
30 import provisioningserver
31-from provisioningserver import plugin as plugin_module
32+from provisioningserver import (
33+ logger,
34+ plugin as plugin_module,
35+)
36 from provisioningserver.config import ClusterConfiguration
37 from provisioningserver.plugin import (
38 Options,
39@@ -78,6 +81,7 @@
40 self.useFixture(ClusterConfigurationFixture())
41 self.patch(provisioningserver, "services", MultiService())
42 self.patch_autospec(crochet, "no_setup")
43+ self.patch_autospec(logger, "basicConfig")
44 self.tempdir = self.make_dir()
45
46 def test_init(self):
47@@ -104,6 +108,7 @@
48 "Not all services are named.")
49 self.assertEqual(service, provisioningserver.services)
50 self.assertThat(crochet.no_setup, MockCalledOnceWith())
51+ self.assertThat(logger.basicConfig, MockCalledOnceWith())
52
53 def test_makeService_patches_tftp_service(self):
54 mock_tftp_patch = (