diff options
Diffstat (limited to 'cloud-init-cfg.py')
-rwxr-xr-x | cloud-init-cfg.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cloud-init-cfg.py b/cloud-init-cfg.py index 49ddf302..0905eb5e 100755 --- a/cloud-init-cfg.py +++ b/cloud-init-cfg.py @@ -60,7 +60,14 @@ def main(): if os.environ.has_key(cfg_env_name): cfg_path = os.environ[cfg_env_name] - cc = CC.CloudConfig(cfg_path) + cloud = cloudinit.CloudInit(ds_deps=[]) # ds_deps=[], get only cached + try: + cloud.get_data_source() + except cloudinit.DataSourceNotFoundException as e: + # there was no datasource found, theres nothing to do + sys.exit(0) + + cc = CC.CloudConfig(cfg_path,cloud) try: (outfmt, errfmt) = CC.get_output_cfg(cc.cfg,modename) |