Skip to content

Commit

Permalink
cloudinit: tweak logs on combined json error cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dbungert committed Jul 25, 2023
1 parent ec25740 commit 2907f87
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions subiquity/cloudinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit 2907f87

Please sign in to comment.