[Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master
Scott Moser has proposed merging ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. Commit message: Centos 6: Fix jinja rendering on older jinja versions. jinja2.runtime.implements_to_string is not available in older versions of jinja2. This just catches that error separately from other jinja support allowing the code to work. The testcase to recreate was: ./tools/run-container --source-package --package \ --artifacts=./rpm/ centos/6 Requested reviews: cloud-init commiters (cloud-init-dev) For more details, see: https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/356079 see commit message -- Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. diff --git a/cloudinit/templater.py b/cloudinit/templater.py index b668674..f1034aa 100644 --- a/cloudinit/templater.py +++ b/cloudinit/templater.py @@ -21,16 +21,19 @@ 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 +try: +from jinja2.runtime import implements_to_string +except (ImportError, AttributeError): +from cloudinit.helpers import identity +implements_to_string = identity + from cloudinit import log as logging from cloudinit import type_utils as tu from cloudinit import util ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master
The proposal to merge ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master has been updated. Commit message changed to: Centos 6: Fix jinja rendering on older jinja versions. jinja2.runtime.implements_to_string is not available in older versions of jinja2. This just catches that error separately from other jinja support allowing the code to work. The testcase to recreate was: ./tools/run-container --source-package --package \ --artifacts=./rpm/ centos/6 LP: #1795933 For more details, see: https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/356079 -- Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master
Do we have a unittest that catches this ? -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/356079 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master
Review: Approve continuous-integration PASSED: Continuous integration, rev:947187840a16d89bf45f129ae7fc3256449caa3c https://jenkins.ubuntu.com/server/job/cloud-init-ci/361/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/361/rebuild -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/356079 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master
we have unit tests that test rendering of jinja2, but because jinja2 is not required dep, it will skip the tests if it is not available. the code here is what determined "do we have jinja2". And the tests skip if not JINJA_AVAILABLE -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/356079 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master
Review: Needs Fixing continuous-integration FAILED: Continuous integration, rev:a9ff70825deaabea9962648cd9ad90b9b4490384 https://jenkins.ubuntu.com/server/job/cloud-init-ci/362/ Executed test runs: SUCCESS: Checkout FAILED: Unit & Style Tests Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/362/rebuild -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/356079 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master
Review: Approve continuous-integration PASSED: Continuous integration, rev:62026771dd7a63dcfb80e48192f4e8464ef08bad https://jenkins.ubuntu.com/server/job/cloud-init-ci/364/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/364/rebuild -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/356079 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/cent-6-jinja2 into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp