Merge ~redriver/cloud-init:fix-ifdown-for-frbsd-on-Azure into cloud-init:master

Proposed by Hongjiang Zhang
Status: Merged
Approved by: Scott Moser
Approved revision: 4558e3d1448d29697a094a638b8f5b5b0c9ca8a8
Merged at revision: ea0a534d93544837e44d03e3394233d28c247f7d
Proposed branch: ~redriver/cloud-init:fix-ifdown-for-frbsd-on-Azure
Merge into: cloud-init:master
Diff against target: 16 lines (+5/-0)
1 file modified
cloudinit/sources/DataSourceAzure.py (+5/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
cloud-init Commiters Pending
Review via email: mp+325713@code.launchpad.net

Commit message

replace ifdown/ifup with "ifconfig down" and "ifconfig up" on FreeBSD

Fix the issue caused by different commands on Linux and FreeBSD. On Linux, we used ifdown and ifup to enable and disable a NIC, but on FreeBSD, the counterpart is "ifconfig down" and "ifconfig up"

LP: #1697815

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
4558e3d... by Hongjiang Zhang

make the string less in one line

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

this seems sane just looking at the diff, i'll look further today.

i think you'd opened a bug though... need to link to it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index a0b9eae..3eda2ce 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -177,6 +177,11 @@ if util.is_FreeBSD():
177 RESOURCE_DISK_PATH = "/dev/" + res_disk177 RESOURCE_DISK_PATH = "/dev/" + res_disk
178 else:178 else:
179 LOG.debug("resource disk is None")179 LOG.debug("resource disk is None")
180 BOUNCE_COMMAND = [
181 'sh', '-xc',
182 "i=$interface; x=0; ",
183 "ifconfig down $i || x=$?; ifconfig up $i || x=$?; exit $x"
184 ]
180185
181BUILTIN_DS_CONFIG = {186BUILTIN_DS_CONFIG = {
182 'agent_command': AGENT_START_BUILTIN,187 'agent_command': AGENT_START_BUILTIN,

Subscribers

People subscribed via source and target branches