diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-18 17:29:16 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-18 17:29:16 -0700 |
commit | fbe7a72b0d5d04cc148b683b7e22ac730af960a6 (patch) | |
tree | 28a46f46bdf86f2d530ec1247154cb904f6af7d8 | |
parent | 24eab2046f2daaaa1ddb09421949430fa18ba28e (diff) | |
download | vyos-cloud-init-fbe7a72b0d5d04cc148b683b7e22ac730af960a6.tar.gz vyos-cloud-init-fbe7a72b0d5d04cc148b683b7e22ac730af960a6.zip |
Fix include once always staying on, only turn it on until a include says to turn it back off, if one of those is encountered
-rw-r--r-- | cloudinit/user_data.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py index bf34943d..b7902d44 100644 --- a/cloudinit/user_data.py +++ b/cloudinit/user_data.py @@ -100,7 +100,7 @@ class UserDataProcessor(object): 'urlcache', entry_fn) def _do_include(self, content, append_msg): - # Inlude a list of urls, one per line + # Include a list of urls, one per line # also support '#include <url here>' # or #include-once '<url here>' include_once_on = False @@ -109,11 +109,14 @@ class UserDataProcessor(object): if lc_line.startswith("#include-once"): line = line[len("#include-once"):].lstrip() # Every following include will now - # not be refetched.... + # not be refetched.... but will be + # re-read from a local urlcache (if it worked) include_once_on = True elif lc_line.startswith("#include"): line = line[len("#include"):].lstrip() - # TODO: Should we turn back off include once here??? + # Disable the include once if it was on + # if it wasn't, then this has no effect. + include_once_on = False if line.startswith("#"): continue include_url = line.strip() |