Skip to content

Commit

Permalink
templater: drop Jinja Python 2 compatibility shim (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
OddBloke authored May 15, 2020
1 parent 09492b1 commit f23a4c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions cloudinit/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,4 @@ def stringify(self, header=None):
contents = '\n'.join([header, contents, ''])
return contents


def identity(object):
return object

# vi: ts=4 expandtab
4 changes: 0 additions & 4 deletions cloudinit/templater.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
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

Expand All @@ -42,7 +39,6 @@
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."""

Expand Down

0 comments on commit f23a4c4

Please sign in to comment.