summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceAzure.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-02-10 20:53:20 -0500
committerScott Moser <smoser@ubuntu.com>2015-02-10 20:53:20 -0500
commitcd632b2f153a61faa48531cb41d0288650e72c71 (patch)
treea3a35b9ca437d999a15fdd25c0a0de88e3cafafb /cloudinit/sources/DataSourceAzure.py
parent78915c97c18d678db10e0fde0d9306823c5f4610 (diff)
parentf5f280cae778bd214b91664f28d9eed997fbcda5 (diff)
downloadvyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.tar.gz
vyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.zip
python3 support.
This gives us functional python3 support. There are likely still bugs, but instance boot on openstack is functional now. LP: #1247132
Diffstat (limited to 'cloudinit/sources/DataSourceAzure.py')
-rw-r--r--cloudinit/sources/DataSourceAzure.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 09bc196d..c599d50f 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -124,7 +124,8 @@ class DataSourceAzureNet(sources.DataSource):
LOG.debug("using files cached in %s", ddir)
# azure / hyper-v provides random data here
- seed = util.load_file("/sys/firmware/acpi/tables/OEM0", quiet=True)
+ seed = util.load_file("/sys/firmware/acpi/tables/OEM0",
+ quiet=True, decode=False)
if seed:
self.metadata['random_seed'] = seed
@@ -151,7 +152,7 @@ class DataSourceAzureNet(sources.DataSource):
# walinux agent writes files world readable, but expects
# the directory to be protected.
- write_files(ddir, files, dirmode=0700)
+ write_files(ddir, files, dirmode=0o700)
# handle the hostname 'publishing'
try:
@@ -390,7 +391,7 @@ def write_files(datadir, files, dirmode=None):
util.ensure_dir(datadir, dirmode)
for (name, content) in files.items():
util.write_file(filename=os.path.join(datadir, name),
- content=content, mode=0600)
+ content=content, mode=0o600)
def invoke_agent(cmd):