Merge ~darkmuggle-deactivatedaccount/cloud-init:lp-1676908-nic_selection_for_meta_data into cloud-init:master

Proposed by Ben Howard
Status: Superseded
Proposed branch: ~darkmuggle-deactivatedaccount/cloud-init:lp-1676908-nic_selection_for_meta_data
Merge into: cloud-init:master
Diff against target: 26 lines (+10/-4)
1 file modified
cloudinit/sources/helpers/digitalocean.py (+10/-4)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
cloud-init Commiters Pending
Review via email: mp+322385@code.launchpad.net

This proposal has been superseded by a proposal from 2017-04-11.

To post a comment you must log in.
Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :

Re-worked interface selection for IPv4LL address.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
ad4d45f... by Ben Howard

DigitalOcean: assign IPv4ll address to lowest indexed interface.

Previously the IPv4LL address for metadata discovery was assigned to the
first interfaces from an alphabetic sort. On DigitalOcean, the metadata
is only accessible from the first interface. This fixes a problem where the
IPv4LL address is bound to the wrong interface with snapshots.

This is part of general improvements to the DigitalOcean Datasource in
bug 1676908.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:da92b43445f07ab02ae673bbfb78c710cde8f297
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~utlemming/cloud-init/+git/cloud-init-1/+merge/322385/+edit-commit-message

https://jenkins.ubuntu.com/server/job/cloud-init-ci/243/
Executed test runs:
    SUCCESS: https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/243
    SUCCESS: https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-arm64/243
    SUCCESS: https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-ppc64el/243
    SUCCESS: https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-s390x/243
    SUCCESS: https://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=vm-i386/243

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/243/rebuild

review: Needs Fixing (continuous-integration)

Unmerged commits

ad4d45f... by Ben Howard

DigitalOcean: assign IPv4ll address to lowest indexed interface.

Previously the IPv4LL address for metadata discovery was assigned to the
first interfaces from an alphabetic sort. On DigitalOcean, the metadata
is only accessible from the first interface. This fixes a problem where the
IPv4LL address is bound to the wrong interface with snapshots.

This is part of general improvements to the DigitalOcean Datasource in
bug 1676908.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/sources/helpers/digitalocean.py b/cloudinit/sources/helpers/digitalocean.py
2index 72f7bde..3fbe83c 100644
3--- a/cloudinit/sources/helpers/digitalocean.py
4+++ b/cloudinit/sources/helpers/digitalocean.py
5@@ -23,11 +23,17 @@ def assign_ipv4_link_local(nic=None):
6 """
7
8 if not nic:
9- for cdev in sorted(cloudnet.get_devicelist()):
10+ cindex = -1
11+ for cdev in cloudnet.get_devicelist():
12 if cloudnet.is_physical(cdev):
13- nic = cdev
14- LOG.debug("assigned nic '%s' for link-local discovery", nic)
15- break
16+ ifindex = cloudnet.read_sys_net_int(cdev, 'ifindex')
17+ if (cindex == -1 or (
18+ cindex != -1 and ifindex < cindex)):
19+ msg = ("'%s' is a candidate for metadata discovery with "
20+ "an index of %s.")
21+ LOG.debug(msg % (cdev, ifindex))
22+ nic = cdev
23+ cindex = ifindex
24
25 if not nic:
26 raise RuntimeError("unable to find interfaces to access the"

Subscribers

People subscribed via source and target branches