Merge ~ssweeny/snappy-hwe-snaps/+git/network-manager:dhcp-leases-run into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/xenial/1.2.2

Proposed by Scott Sweeny
Status: Merged
Approved by: Simon Fels
Approved revision: 275d12ba0f70753f3258dda8298609ef95974cff
Merged at revision: 98b73a2d382e9a33b8a4135714dc45f1dae4b8a5
Proposed branch: ~ssweeny/snappy-hwe-snaps/+git/network-manager:dhcp-leases-run
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/xenial/1.2.2
Diff against target: 17 lines (+4/-2)
1 file modified
src/dhcp-manager/nm-dhcp-systemd.c (+4/-2)
Reviewer Review Type Date Requested Status
Tony Espy Approve
Simon Fels Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+307371@code.launchpad.net

Commit message

[SNAPPY] Write DHCP lease files to /run/NetworkManager/dhcp/

Description of the change

Change the DHCP manager to store lease files in /run/NetworkManager/dhcp

This requires a change to the network-manager interface which landed in snapd today.

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tony Espy (awe) wrote :

Upstream uses NMSTATEDIR for constructing the internal lease paths. Our original snappy support commit changed the code to use nm_get_state_dir().

As we're now changing this path to a writable system directory, it might be worthwhile to add a short comment explaining why this is being done, vs. using nm_utils_get_run_dir() or nm_utils_get_state_dir().

Otherwise looks good.

review: Needs Fixing
Revision history for this message
Scott Sweeny (ssweeny) wrote :

Done.

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve
Revision history for this message
Simon Fels (morphis) wrote :

Top-approving this now to get the development process forward. @Tony: Hope you're ok with this.

Revision history for this message
Tony Espy (awe) wrote :

+1, just wanted the comment added, so we're good to go.

Revision history for this message
Tony Espy (awe) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c
2index 80e6523..bf2a10d 100644
3--- a/src/dhcp-manager/nm-dhcp-systemd.c
4+++ b/src/dhcp-manager/nm-dhcp-systemd.c
5@@ -398,8 +398,10 @@ lease_to_ip4_config (const char *iface,
6 static char *
7 get_leasefile_path (const char *iface, const char *uuid, gboolean ipv6)
8 {
9- return g_strdup_printf ("%s/internal%s-%s-%s.lease",
10- nm_utils_get_state_dir(),
11+ /* Store lease files in a well-known system location so they can be
12+ * read by external utilities.
13+ */
14+ return g_strdup_printf ("/run/NetworkManager/dhcp/internal%s-%s-%s.lease",
15 ipv6 ? "6" : "",
16 uuid,
17 iface);

Subscribers

People subscribed via source and target branches