summaryrefslogtreecommitdiff
path: root/cloudinit/config/schema.py
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2023-05-12 11:29:15 -0600
committerGitHub <noreply@github.com>2023-05-12 11:29:15 -0600
commit73f34575da4f99a376998516a13c3a79cc640ae3 (patch)
tree06f396d4fcda64ad8cb4476538b50d524c59a2b9 /cloudinit/config/schema.py
parent9f8450368c2ae713de0a2308f5d3cb73de5b39f2 (diff)
downloadcloud-init-git-73f34575da4f99a376998516a13c3a79cc640ae3.tar.gz
schema: read_cfg_paths call init.fetch to lookup /v/l/c/instance
Fix cloud-init schema --system being unable to find merged userdata stored at /var/lib/cloud/instance/cloud_config.txt. Init.paths.get_ipath only has visibility to merged cloud config in /var/lib/cloud/<instance_id>/cloud-config.txt after fetching the existing cached datasource which provides instance-id from metadata in order to determine the unique instance-id which represents the path to the cloud-config.txt. To support reuse of read_cfg_paths helper function, add an optional parameter fetch_existing_datasource which indicates whether reading the existing datasource is necessary for this helper function. cloud-init schema --system calls read_cfg_paths providing fetch_existing_datasource="trust" prior to calls to paths.get_ipath().
Diffstat (limited to 'cloudinit/config/schema.py')
-rw-r--r--cloudinit/config/schema.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/config/schema.py b/cloudinit/config/schema.py
index 9005e924..4b7e8016 100644
--- a/cloudinit/config/schema.py
+++ b/cloudinit/config/schema.py
@@ -1264,7 +1264,7 @@ def handle_schema_args(name, args):
if args.docs:
print(load_doc(args.docs))
return
- paths = read_cfg_paths()
+ paths = read_cfg_paths(fetch_existing_datasource="trust")
if args.instance_data:
instance_data_path = args.instance_data
elif os.getuid() != 0: