diff options
author | Ben Howard <ben.howard@canonical.com> | 2014-02-14 09:46:11 -0700 |
---|---|---|
committer | Ben Howard <ben.howard@canonical.com> | 2014-02-14 09:46:11 -0700 |
commit | 2d9601f36a9dede852d68bc8a299f0594d540b84 (patch) | |
tree | b2a2670f188170cb5acb503da3bc32210d8e2eff /cloudinit/sources/DataSourceSmartOS.py | |
parent | 12672e77a2881f9a87d2dcb4217e5e56b8b3dfd6 (diff) | |
download | vyos-cloud-init-2d9601f36a9dede852d68bc8a299f0594d540b84.tar.gz vyos-cloud-init-2d9601f36a9dede852d68bc8a299f0594d540b84.zip |
The symlink of /var/lib/cloud/instance is not created at the time that the
datasource for SmartOS runs. This patch creates the instance's directory.
Diffstat (limited to 'cloudinit/sources/DataSourceSmartOS.py')
-rw-r--r-- | cloudinit/sources/DataSourceSmartOS.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py index ec561b0d..8d4a16e6 100644 --- a/cloudinit/sources/DataSourceSmartOS.py +++ b/cloudinit/sources/DataSourceSmartOS.py @@ -161,7 +161,6 @@ class DataSourceSmartOS(sources.DataSource): self.b64_keys = self.ds_cfg.get('base64_keys') self.b64_all = self.ds_cfg.get('base64_all') self.script_base_d = os.path.join(self.paths.get_cpath("scripts")) - self.data_d = os.path.join(self.paths.instance_link, 'data') def __str__(self): root = sources.DataSource.__str__(self) @@ -207,12 +206,14 @@ class DataSourceSmartOS(sources.DataSource): # We write 'user-script' and 'operator-script' into the # instance/data directory. The default vendor-data then handles # executing them later. - user_script = os.path.join(self.data_d, 'user-script') + data_d = os.path.join(self.paths.get_cpath(), 'instances', + md['instance-id'], 'data') + user_script = os.path.join(data_d, 'user-script') u_script_l = "%s/user-script" % LEGACY_USER_D write_boot_content(md.get('user-script'), content_f=user_script, link=u_script_l, shebang=True, mode=0700) - operator_script = os.path.join(self.data_d, 'operator-script') + operator_script = os.path.join(data_d, 'operator-script') write_boot_content(md.get('operator-script'), content_f=operator_script, shebang=False, mode=0700) |