From ea0a534d93544837e44d03e3394233d28c247f7d Mon Sep 17 00:00:00 2001 From: Hongjiang Zhang Date: Tue, 13 Jun 2017 16:21:02 +0800 Subject: FreeBSD: replace ifdown/ifup with "ifconfig down" and "ifconfig up". 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 --- cloudinit/sources/DataSourceAzure.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cloudinit/sources') diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index a8bad90b..ebb53d0a 100644 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -177,6 +177,11 @@ if util.is_FreeBSD(): RESOURCE_DISK_PATH = "/dev/" + res_disk else: LOG.debug("resource disk is None") + BOUNCE_COMMAND = [ + 'sh', '-xc', + ("i=$interface; x=0; ifconfig down $i || x=$?; " + "ifconfig up $i || x=$?; exit $x") + ] BUILTIN_DS_CONFIG = { 'agent_command': AGENT_START_BUILTIN, -- cgit v1.2.3