-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1735 from dbungert/consume-combined-cloud-config
Obtain autoinstall from combined-cloud-config
- Loading branch information
Showing
3 changed files
with
54 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
"""Shared cloudinit utility functions""" | ||
|
||
import json | ||
import logging | ||
|
||
log = logging.getLogger("subiquity.cloudinit") | ||
|
||
|
||
def get_host_combined_cloud_config() -> dict: | ||
"""Return the host system /run/cloud-init/combined-cloud-config.json""" | ||
try: | ||
with open("/run/cloud-init/combined-cloud-config.json") as fp: | ||
return json.load(fp) | ||
config = json.load(fp) | ||
log.debug( | ||
"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") | ||
return {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters