diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-03-23 10:31:11 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-03-23 10:31:11 -0400 |
commit | 5b3cad36be8981cd12cffdf5c5e539b522404000 (patch) | |
tree | f2ae50ad2a63a0ccff55f91ef1366319d599ee83 | |
parent | ed55d6bac52c53b9473b9644ce50f61404bfd438 (diff) | |
download | vyos-cloud-init-5b3cad36be8981cd12cffdf5c5e539b522404000.tar.gz vyos-cloud-init-5b3cad36be8981cd12cffdf5c5e539b522404000.zip |
trust existing datasource in modules or single
This fixes a bug where modules mode was not passing a 'existing'
flag to fetch. fetch had existing default to 'check'.
The DataSourceNoCloud when fed with data from a disk will return
False to check() as it is not a guarantee'd hit.
That caused fetch to go looking for a new datasource.
That would have actually worked, but modules and single create
the Init with deps=[]. So it went looking for Datasources
that matched those deps, and only found DataSourceNone.
I'm going to keep having modules and single specify deps=[]
as that will prevent them from going to look for a DS and
further making things worse.
-rwxr-xr-x | bin/cloud-init | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/cloud-init b/bin/cloud-init index 8875d2f6..341359e3 100755 --- a/bin/cloud-init +++ b/bin/cloud-init @@ -329,7 +329,7 @@ def main_modules(action_name, args): init.read_cfg(extract_fns(args)) # Stage 2 try: - init.fetch() + init.fetch(existing="trust") except sources.DataSourceNotFoundException: # There was no datasource found, theres nothing to do msg = ('Can not apply stage %s, no datasource found! Likely bad ' @@ -383,7 +383,7 @@ def main_single(name, args): init.read_cfg(extract_fns(args)) # Stage 2 try: - init.fetch() + init.fetch(existing="trust") except sources.DataSourceNotFoundException: # There was no datasource found, # that might be bad (or ok) depending on |