summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)