summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceAzure.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-09-09 17:09:43 -0400
committerScott Moser <smoser@ubuntu.com>2013-09-09 17:09:43 -0400
commit8e5b1fef27fa715e9ff8ef0130ada4869f8258e6 (patch)
tree2c2ff0e1ffd1df50ce98c2e4c6b5b9dd54c78dad /cloudinit/sources/DataSourceAzure.py
parent1bda6f6d525150966ae6d611222c659838ee8669 (diff)
downloadvyos-cloud-init-8e5b1fef27fa715e9ff8ef0130ada4869f8258e6.tar.gz
vyos-cloud-init-8e5b1fef27fa715e9ff8ef0130ada4869f8258e6.zip
add support for reading random_seed on azure also.
Diffstat (limited to 'cloudinit/sources/DataSourceAzure.py')
-rw-r--r--cloudinit/sources/DataSourceAzure.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 66d7728b..7c50de4c 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -106,6 +106,14 @@ class DataSourceAzureNet(sources.DataSource):
if found == ddir:
LOG.debug("using files cached in %s", ddir)
+ rseedf = "/sys/firmware/acpi/tables/OEM0"
+ if os.path.isfile(rseedf):
+ try:
+ with open(rseedf, "rb") as fp:
+ self.metadata['random_seed'] = fp.read()
+ except:
+ LOG.warn("random seed '%s' existed but read failed", rseedf)
+
# now update ds_cfg to reflect contents pass in config
usercfg = util.get_cfg_by_path(self.cfg, DS_CFG_PATH, {})
self.ds_cfg = util.mergemanydict([usercfg, self.ds_cfg])