Merge ~andreserl/maas:minor_better_logs into maas:master

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 97ebed2de9ec1041194fade383f4b01b6c709140
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~andreserl/maas:minor_better_logs
Merge into: maas:master
Diff against target: 46 lines (+8/-8)
1 file modified
src/maasserver/dhcp.py (+8/-8)
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Approve
Review via email: mp+355807@code.launchpad.net

Commit message

Log the hostname for DHCP logs.

To post a comment you must log in.
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/dhcp.py b/src/maasserver/dhcp.py
2index ba36fc7..7dd3d50 100644
3--- a/src/maasserver/dhcp.py
4+++ b/src/maasserver/dhcp.py
5@@ -776,16 +776,16 @@ def configure_dhcp(rack_controller):
6 ipv4_status = SERVICE_STATUS.DEAD
7 log.err(
8 None,
9- "Error configuring DHCPv4 on rack controller '%s': %s" % (
10- rack_controller.system_id, exc))
11+ "Error configuring DHCPv4 on rack controller '%s (%s)': %s" % (
12+ rack_controller.hostname, rack_controller.system_id, exc))
13 else:
14 if len(config.shared_networks_v4) > 0:
15 ipv4_status = SERVICE_STATUS.RUNNING
16 else:
17 ipv4_status = SERVICE_STATUS.OFF
18 log.msg(
19- "Successfully configured DHCPv4 on rack controller '%s'." % (
20- rack_controller.system_id))
21+ "Successfully configured DHCPv4 on rack controller '%s (%s)'." % (
22+ rack_controller.hostname, rack_controller.system_id))
23
24 try:
25 yield _perform_dhcp_config(
26@@ -799,16 +799,16 @@ def configure_dhcp(rack_controller):
27 ipv6_status = SERVICE_STATUS.DEAD
28 log.err(
29 None,
30- "Error configuring DHCPv6 on rack controller '%s': %s" % (
31- rack_controller.system_id, exc))
32+ "Error configuring DHCPv6 on rack controller '%s (%s)': %s" % (
33+ rack_controller.hostname, rack_controller.system_id, exc))
34 else:
35 if len(config.shared_networks_v6) > 0:
36 ipv6_status = SERVICE_STATUS.RUNNING
37 else:
38 ipv6_status = SERVICE_STATUS.OFF
39 log.msg(
40- "Successfully configured DHCPv6 on rack controller '%s'." % (
41- rack_controller.system_id))
42+ "Successfully configured DHCPv6 on rack controller '%s (%s)'." % (
43+ rack_controller.hostname, rack_controller.system_id))
44
45 # Update the status for both services so the user is always seeing the
46 # most up to date status.

Subscribers

People subscribed via source and target branches