summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2014-10-11 18:47:06 -0700
committerJoshua Harlow <harlowja@gmail.com>2014-10-11 18:47:06 -0700
commit1f969e30983f93eed2ece906a6ca9d16bc0aed86 (patch)
treef60bf97ce16042a1297e0eee11629edee06cb2bf
parent4994f7cb475713be523f96e077a76f801e6d1db5 (diff)
downloadvyos-cloud-init-1f969e30983f93eed2ece906a6ca9d16bc0aed86.tar.gz
vyos-cloud-init-1f969e30983f93eed2ece906a6ca9d16bc0aed86.zip
Use the util function to get the chef base directories
-rw-r--r--cloudinit/config/cc_chef.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
index 205f4b49..fb8d7641 100644
--- a/cloudinit/config/cc_chef.py
+++ b/cloudinit/config/cc_chef.py
@@ -118,7 +118,10 @@ def handle(name, cfg, cloud, log, _args):
chef_cfg = cfg['chef']
# Ensure the chef directories we use exist
- for d in list(chef_cfg.get('directories', CHEF_DIRS)):
+ chef_dirs = util.get_cfg_option_list(chef_cfg, 'directories')
+ if not chef_dirs:
+ chef_dirs = list(CHEF_DIRS)
+ for d in chef_dirs:
util.ensure_dir(d)
# Set the validation key based on the presence of either 'validation_key'