diff options
author | Hongjiang Zhang <honzhan@microsoft.com> | 2017-06-13 16:21:02 +0800 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-06-15 15:28:52 -0400 |
commit | ea0a534d93544837e44d03e3394233d28c247f7d (patch) | |
tree | 9537e40b77054cb0bf61e8bbdbc5f1759de0b26a /cloudinit/sources/DataSourceAzure.py | |
parent | 8a06a1244c8ee20902db050e142c5a0b2fd777a9 (diff) | |
download | vyos-cloud-init-ea0a534d93544837e44d03e3394233d28c247f7d.tar.gz vyos-cloud-init-ea0a534d93544837e44d03e3394233d28c247f7d.zip |
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
Diffstat (limited to 'cloudinit/sources/DataSourceAzure.py')
-rw-r--r-- | cloudinit/sources/DataSourceAzure.py | 5 |
1 files changed, 5 insertions, 0 deletions
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, |