summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-09-12 15:49:09 -0400
committerScott Moser <smoser@brickies.net>2016-09-12 15:49:09 -0400
commit4610e3268996fdfff0cbaabce1198829466fdd78 (patch)
tree78bfa08f9dff0e77e945663775097217ae8ff8ae /cloudinit
parentb7d3e3b4064dcf500d02a95291d0d4b66ae2bf83 (diff)
parent65ace7b35494dba1747eece815754ab8573d83d8 (diff)
downloadvyos-cloud-init-4610e3268996fdfff0cbaabce1198829466fdd78.tar.gz
vyos-cloud-init-4610e3268996fdfff0cbaabce1198829466fdd78.zip
merge from master at 0.7.7-31-g65ace7b
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/DataSourceOVF.py8
-rw-r--r--cloudinit/sources/helpers/openstack.py14
2 files changed, 11 insertions, 11 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py
index 43347cfb..5b3bdb4e 100644
--- a/cloudinit/sources/DataSourceOVF.py
+++ b/cloudinit/sources/DataSourceOVF.py
@@ -237,7 +237,7 @@ def wait_for_imc_cfg_file(dirpath, filename, maxwait=180, naplen=5):
def read_vmware_imc(config):
md = {}
cfg = {}
- ud = ""
+ ud = None
if config.host_name:
if config.domain_name:
md['local-hostname'] = config.host_name + "." + config.domain_name
@@ -256,7 +256,7 @@ def read_ovf_environment(contents):
props = get_properties(contents)
md = {}
cfg = {}
- ud = ""
+ ud = None
cfg_props = ['password']
md_props = ['seedfrom', 'local-hostname', 'public-keys', 'instance-id']
for (prop, val) in props.items():
@@ -268,9 +268,9 @@ def read_ovf_environment(contents):
cfg[prop] = val
elif prop == "user-data":
try:
- ud = base64.decodestring(val)
+ ud = base64.b64decode(val.encode())
except Exception:
- ud = val
+ ud = val.encode()
return (md, ud, cfg)
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index a5a2a1d6..61b0b08c 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -555,11 +555,12 @@ def convert_net_json(network_json=None, known_macs=None):
if 'name' in link:
cfg['name'] = link['name']
+ link_mac_addr = None
if link.get('ethernet_mac_address'):
- link_id_info[link['id']] = link.get('ethernet_mac_address')
+ link_mac_addr = link.get('ethernet_mac_address').lower()
+ link_id_info[link['id']] = link_mac_addr
- curinfo = {'name': cfg.get('name'),
- 'mac': link.get('ethernet_mac_address'),
+ curinfo = {'name': cfg.get('name'), 'mac': link_mac_addr,
'id': link['id'], 'type': link['type']}
for network in [n for n in networks
@@ -582,10 +583,9 @@ def convert_net_json(network_json=None, known_macs=None):
subnet['ipv6'] = True
subnets.append(subnet)
cfg.update({'subnets': subnets})
- if link['type'] in ['ethernet', 'vif', 'ovs', 'phy', 'bridge', 'tap']:
- cfg.update({
- 'type': 'physical',
- 'mac_address': link['ethernet_mac_address']})
+ if link['type'] in [None, 'ethernet', 'vif', 'ovs', 'phy',
+ 'bridge', 'tap']:
+ cfg.update({'type': 'physical', 'mac_address': link_mac_addr})
elif link['type'] in ['bond']:
params = {}
for k, v in link.items():