summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceNoCloud.py
diff options
context:
space:
mode:
authorGreg Padgett <gpadgett@redhat.com>2013-03-26 17:48:40 -0400
committerGreg Padgett <gpadgett@redhat.com>2013-03-26 17:48:40 -0400
commit984c72e522c585c6d3f6b3d3aec39fb21dd84028 (patch)
tree599087f987fe534d4bc8acff8c8e3a0ae074deaa /cloudinit/sources/DataSourceNoCloud.py
parent41190448decad51cf76a85d727e6935a8a206cca (diff)
downloadvyos-cloud-init-984c72e522c585c6d3f6b3d3aec39fb21dd84028.tar.gz
vyos-cloud-init-984c72e522c585c6d3f6b3d3aec39fb21dd84028.zip
compatibility fixes for Fedora and RHEL
This patch fixes issues in Fedora 18 (and upcoming RHEL 7) which are present due to their use of systemd: - store locale configuration in /etc/locale.conf - store hostname in /etc/hostname - use a symlink for /etc/localtime (prior code would set the timezone but corrupt data in /usr/share/zoneinfo due to presence of symlink) It also contains fixes for issues unrelated to systemd adoption: - explicitly scan /dev/sr0 with blkid in order to get the optical drive in the blkid cache. This prevents an issue on systems running 2.6 kernels (such as RHEL 6) in which config disks on some devices won't be detected unless the device has previously been queried. (For reference, see https://patchwork.kernel.org/patch/1770241/) - append a newline when rewriting sysconfig files, as this is customary text configuration file formatting and is expected by some parsers (such as the ifcfg-rh plugin for NetworkManager)
Diffstat (limited to 'cloudinit/sources/DataSourceNoCloud.py')
-rw-r--r--cloudinit/sources/DataSourceNoCloud.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py
index 08a853cc..01c99028 100644
--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -87,6 +87,9 @@ class DataSourceNoCloud(sources.DataSource):
label = self.ds_cfg.get('fs_label', "cidata")
if label is not None:
+ # Query optical drive to get it in blkid cache for 2.6 kernels
+ util.find_devs_with(path="/dev/sr0")
+
fslist = util.find_devs_with("TYPE=vfat")
fslist.extend(util.find_devs_with("TYPE=iso9660"))