cloudinit: tweak logs on combined json error cases

This commit is contained in:
Dan Bungert 2023-07-25 17:04:31 -06:00
parent ec2574009a
commit 2907f87411
1 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,12 @@ def get_host_combined_cloud_config() -> dict:
"Loaded cloud config from /run/cloud-init/combined-cloud-config.json"
)
return config
except (IOError, OSError, AttributeError, json.decoder.JSONDecodeError):
log.debug("Failed to load combined-cloud-config")
except FileNotFoundError:
log.debug(
"Failed to load combined-cloud-config, file not found. "
"This is expected for cloud-init <= v23.2.1."
)
return {}
except (IOError, OSError, AttributeError, json.decoder.JSONDecodeError) as ex:
log.debug("Failed to load combined-cloud-config: %s", ex)
return {}