summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-04-10 16:22:47 -0400
committerScott Moser <smoser@ubuntu.com>2012-04-10 16:22:47 -0400
commit4d9722ba567a6ed2e355a464f67fddcad1717aa2 (patch)
tree9fff17d7b4e0d3edf754f24c87146cffb23ab952 /cloudinit/CloudConfig
parentd91155463c9a63491dda2d59302f908f6b8f6167 (diff)
downloadvyos-cloud-init-4d9722ba567a6ed2e355a464f67fddcad1717aa2.tar.gz
vyos-cloud-init-4d9722ba567a6ed2e355a464f67fddcad1717aa2.zip
cc_landscape.py: if /etc/landscape does not exist, then create it
LP: #978329
Diffstat (limited to 'cloudinit/CloudConfig')
-rw-r--r--cloudinit/CloudConfig/cc_landscape.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/CloudConfig/cc_landscape.py b/cloudinit/CloudConfig/cc_landscape.py
index 596fd67e..a4113cbe 100644
--- a/cloudinit/CloudConfig/cc_landscape.py
+++ b/cloudinit/CloudConfig/cc_landscape.py
@@ -18,6 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import os
+import os.path
from cloudinit.CloudConfig import per_instance
from configobj import ConfigObj
@@ -50,6 +52,9 @@ def handle(_name, cfg, _cloud, log, _args):
merged = mergeTogether([lsc_builtincfg, lsc_client_cfg_file, ls_cloudcfg])
+ if not os.path.isdir(os.path.dirname(lsc_client_cfg_file)):
+ os.makedirs(os.path.dirname(lsc_client_cfg_file))
+
with open(lsc_client_cfg_file, "w") as fp:
merged.write(fp)