From 5b3cad36be8981cd12cffdf5c5e539b522404000 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 23 Mar 2016 10:31:11 -0400 Subject: 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. --- bin/cloud-init | 4 ++-- 1 file 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 -- cgit v1.2.3