summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-02-14 11:51:10 -0500
committerScott Moser <smoser@ubuntu.com>2014-02-14 11:51:10 -0500
commit08a4c6b7e91134c2b2c56330ece85a17a1061f00 (patch)
treeb2a2670f188170cb5acb503da3bc32210d8e2eff /cloudinit/sources
parent12672e77a2881f9a87d2dcb4217e5e56b8b3dfd6 (diff)
parent2d9601f36a9dede852d68bc8a299f0594d540b84 (diff)
downloadvyos-cloud-init-08a4c6b7e91134c2b2c56330ece85a17a1061f00.tar.gz
vyos-cloud-init-08a4c6b7e91134c2b2c56330ece85a17a1061f00.zip
smartos: fix bug in previous commit
The code in the previous commit was creating /var/lib/cloud/instance/ when it should not have. This is better handled now by using /var/lib/cloud/instances/<instance-id>, and then letting the link get created by cloud-init elsewhere.
Diffstat (limited to 'cloudinit/sources')
-rw-r--r--cloudinit/sources/DataSourceSmartOS.py7
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)