diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-05-14 23:22:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 21:22:27 -0600 |
commit | f23a4c4262ac11cd75c99fcbfbfe453f4e115f18 (patch) | |
tree | 98c7db2e9e7e6fb064ad933d618ea1c0163a629d /cloudinit | |
parent | 09492b1d0f4b1826a7a98709c61d48bf14a1ec64 (diff) | |
download | vyos-cloud-init-f23a4c4262ac11cd75c99fcbfbfe453f4e115f18.tar.gz vyos-cloud-init-f23a4c4262ac11cd75c99fcbfbfe453f4e115f18.zip |
templater: drop Jinja Python 2 compatibility shim (#353)
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/helpers.py | 4 | ||||
-rw-r--r-- | cloudinit/templater.py | 4 |
2 files changed, 0 insertions, 8 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py index 7d2a3305..9752ad28 100644 --- a/cloudinit/helpers.py +++ b/cloudinit/helpers.py @@ -451,8 +451,4 @@ class DefaultingConfigParser(RawConfigParser): contents = '\n'.join([header, contents, '']) return contents - -def identity(object): - return object - # vi: ts=4 expandtab diff --git a/cloudinit/templater.py b/cloudinit/templater.py index e47cdeda..a00ade20 100644 --- a/cloudinit/templater.py +++ b/cloudinit/templater.py @@ -21,13 +21,10 @@ except (ImportError, AttributeError): CHEETAH_AVAILABLE = False try: - from jinja2.runtime import implements_to_string from jinja2 import Template as JTemplate from jinja2 import DebugUndefined as JUndefined JINJA_AVAILABLE = True except (ImportError, AttributeError): - from cloudinit.helpers import identity - implements_to_string = identity JINJA_AVAILABLE = False JUndefined = object @@ -42,7 +39,6 @@ BASIC_MATCHER = re.compile(r'\$\{([A-Za-z0-9_.]+)\}|\$([A-Za-z0-9_.]+)') MISSING_JINJA_PREFIX = u'CI_MISSING_JINJA_VAR/' -@implements_to_string # Needed for python2.7. Otherwise cached super.__str__ class UndefinedJinjaVariable(JUndefined): """Class used to represent any undefined jinja template variable.""" |