diff options
author | Scott Moser <smoser@brickies.net> | 2017-05-26 15:53:48 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-05-26 15:53:48 -0400 |
commit | cc9748215f612b8c600c1080c60af71fe7624c47 (patch) | |
tree | 3f008cb6350adf6bc003d2d5ad2d851c9506b81e /cloudinit/sources/helpers | |
parent | 3dd56b4504003928bace87a7e67b08e9376fc6c1 (diff) | |
parent | 16a7302f6acb69adb0aee75eaf12392fa3688853 (diff) | |
download | vyos-cloud-init-cc9748215f612b8c600c1080c60af71fe7624c47.tar.gz vyos-cloud-init-cc9748215f612b8c600c1080c60af71fe7624c47.zip |
merge from master at 0.7.9-153-g16a7302f
Diffstat (limited to 'cloudinit/sources/helpers')
-rw-r--r-- | cloudinit/sources/helpers/azure.py | 11 | ||||
-rw-r--r-- | cloudinit/sources/helpers/digitalocean.py | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/cloudinit/sources/helpers/azure.py b/cloudinit/sources/helpers/azure.py index 6e01aa47..e22409d1 100644 --- a/cloudinit/sources/helpers/azure.py +++ b/cloudinit/sources/helpers/azure.py @@ -29,6 +29,14 @@ def cd(newdir): os.chdir(prevdir) +def _get_dhcp_endpoint_option_name(): + if util.is_FreeBSD(): + azure_endpoint = "option-245" + else: + azure_endpoint = "unknown-245" + return azure_endpoint + + class AzureEndpointHttpClient(object): headers = { @@ -235,8 +243,9 @@ class WALinuxAgentShim(object): leases = [] content = util.load_file(fallback_lease_file) LOG.debug("content is %s", content) + option_name = _get_dhcp_endpoint_option_name() for line in content.splitlines(): - if 'unknown-245' in line: + if option_name in line: # Example line from Ubuntu # option unknown-245 a8:3f:81:10; leases.append(line.strip(' ').split(' ', 2)[-1].strip(';\n"')) diff --git a/cloudinit/sources/helpers/digitalocean.py b/cloudinit/sources/helpers/digitalocean.py index 257989e8..693f8d5c 100644 --- a/cloudinit/sources/helpers/digitalocean.py +++ b/cloudinit/sources/helpers/digitalocean.py @@ -162,7 +162,7 @@ def convert_network_configuration(config, dns_servers): continue sub_part = _get_subnet_part(raw_subnet) - if netdef in ('private', 'anchor_ipv4', 'anchor_ipv6'): + if nic_type != "public" or "anchor" in netdef: del sub_part['gateway'] subnets.append(sub_part) |