summaryrefslogtreecommitdiff
path: root/cloudinit/cmd/devel/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/cmd/devel/__init__.py')
-rw-r--r--[-rwxr-xr-x]cloudinit/cmd/devel/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/cloudinit/cmd/devel/__init__.py b/cloudinit/cmd/devel/__init__.py
index 9a8f2ebd..357c4ae7 100755..100644
--- a/cloudinit/cmd/devel/__init__.py
+++ b/cloudinit/cmd/devel/__init__.py
@@ -17,9 +17,17 @@ def addLogHandlerCLI(logger, log_level):
return logger
-def read_cfg_paths() -> Paths:
- """Return a Paths object based on the system configuration on disk."""
+def read_cfg_paths(fetch_existing_datasource: str = "") -> Paths:
+ """Return a Paths object based on the system configuration on disk.
+
+ :param fetch_existing_datasource: String one of check or trust. Whether to
+ load the pickled datasource before returning Paths. This is necessary
+ when using instance paths via Paths.get_ipath method which are only
+ known from the instance-id metadata in the detected datasource.
+ """
init = Init(ds_deps=[])
+ if fetch_existing_datasource:
+ init.fetch(existing=fetch_existing_datasource)
init.read_cfg()
return init.paths