Bladeren bron

Merge branch 'trunk' into branch-alerts-dev

Nate Cole 10 jaren geleden
bovenliggende
commit
91ae5f27e9
100 gewijzigde bestanden met toevoegingen van 341 en 398 verwijderingen
  1. 0 51
      ambari-admin/src/main/resources/ui/admin-web/gulpfile.js
  2. 0 9
      ambari-admin/src/main/resources/ui/admin-web/package.json
  3. 6 6
      ambari-agent/pom.xml
  4. 1 1
      ambari-agent/src/main/python/ambari_agent/HostInfo.py
  5. 2 2
      ambari-agent/src/test/python/ambari_agent/TestHardware.py
  6. 1 1
      ambari-agent/src/test/python/resource_management/TestContentSources.py
  7. 4 4
      ambari-agent/src/test/python/resource_management/TestPackageResource.py
  8. 8 8
      ambari-agent/src/test/python/resource_management/TestRepositoryResource.py
  9. 4 4
      ambari-common/src/main/python/ambari_commons/os_check.py
  10. 0 0
      ambari-common/src/main/python/ambari_jinja2/AUTHORS
  11. 2 2
      ambari-common/src/main/python/ambari_jinja2/CHANGES
  12. 0 0
      ambari-common/src/main/python/ambari_jinja2/LICENSE
  13. 4 4
      ambari-common/src/main/python/ambari_jinja2/MANIFEST.in
  14. 0 0
      ambari-common/src/main/python/ambari_jinja2/Makefile
  15. 8 8
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/__init__.py
  16. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_debugsupport.c
  17. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/__init__.py
  18. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_bundle.py
  19. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_constants.py
  20. 1 1
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_native.py
  21. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/tests.py
  22. 1 1
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_stringdefs.py
  23. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/bccache.py
  24. 8 8
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/compiler.py
  25. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/constants.py
  26. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/debug.py
  27. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/defaults.py
  28. 16 16
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/environment.py
  29. 1 1
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/exceptions.py
  30. 12 12
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/ext.py
  31. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/filters.py
  32. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/lexer.py
  33. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/loaders.py
  34. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/meta.py
  35. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/nodes.py
  36. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/optimizer.py
  37. 7 7
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/parser.py
  38. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/runtime.py
  39. 7 7
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/sandbox.py
  40. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/tests.py
  41. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/__init__.py
  42. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/api.py
  43. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/core_tags.py
  44. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/debug.py
  45. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/doctests.py
  46. 25 25
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/ext.py
  47. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/filters.py
  48. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/imports.py
  49. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/inheritance.py
  50. 4 4
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/lexnparse.py
  51. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/loader.py
  52. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/regression.py
  53. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/broken.html
  54. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/foo/test.html
  55. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/syntaxerror.html
  56. 0 0
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/test.html
  57. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/security.py
  58. 3 3
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/tests.py
  59. 5 5
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/utils.py
  60. 6 6
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/utils.py
  61. 2 2
      ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/visitor.py
  62. 2 2
      ambari-common/src/main/python/ambari_jinja2/artwork/jinjalogo.svg
  63. 0 0
      ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_alt_unicode.py
  64. 0 0
      ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_broken_reraising.py
  65. 0 0
      ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_xrange2.py
  66. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/Makefile
  67. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_static/jinja.js
  68. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_static/print.css
  69. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_static/style.css
  70. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/genindex.html
  71. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/layout.html
  72. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/opensearch.xml
  73. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/page.html
  74. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/_templates/search.html
  75. 40 40
      ambari-common/src/main/python/ambari_jinja2/docs/api.rst
  76. 2 2
      ambari-common/src/main/python/ambari_jinja2/docs/cache_extension.py
  77. 3 0
      ambari-common/src/main/python/ambari_jinja2/docs/changelog.rst
  78. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/conf.py
  79. 23 23
      ambari-common/src/main/python/ambari_jinja2/docs/extensions.rst
  80. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/faq.rst
  81. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/index.rst
  82. 4 4
      ambari-common/src/main/python/ambari_jinja2/docs/integration.rst
  83. 8 8
      ambari-common/src/main/python/ambari_jinja2/docs/intro.rst
  84. 4 4
      ambari-common/src/main/python/ambari_jinja2/docs/jinjaext.py
  85. 1 1
      ambari-common/src/main/python/ambari_jinja2/docs/sandbox.rst
  86. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/switching.rst
  87. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/templates.rst
  88. 0 0
      ambari-common/src/main/python/ambari_jinja2/docs/tricks.rst
  89. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/basic/cycle.py
  90. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/debugger.py
  91. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/inheritance.py
  92. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/broken.html
  93. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/subbroken.html
  94. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/test.py
  95. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/basic/test_filter_and_linestatements.py
  96. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/basic/test_loop_filter.py
  97. 2 2
      ambari-common/src/main/python/ambari_jinja2/examples/basic/translate.py
  98. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/bench.py
  99. 1 1
      ambari-common/src/main/python/ambari_jinja2/examples/profile.py
  100. 0 0
      ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_form.html

+ 0 - 51
ambari-admin/src/main/resources/ui/admin-web/gulpfile.js

@@ -30,13 +30,6 @@ gulp.task('styles', function () {
         .pipe($.size());
         .pipe($.size());
 });
 });
 
 
-gulp.task('scripts', function () {
-    return gulp.src('app/scripts/**/*.js')
-        .pipe($.jshint())
-        .pipe($.jshint.reporter(require('jshint-stylish')))
-        .pipe($.size());
-});
-
 gulp.task('html', ['styles'], function () {
 gulp.task('html', ['styles'], function () {
     var jsFilter = $.filter('**/*.js');
     var jsFilter = $.filter('**/*.js');
     var cssFilter = $.filter('**/*.css');
     var cssFilter = $.filter('**/*.css');
@@ -48,7 +41,6 @@ gulp.task('html', ['styles'], function () {
         .pipe($.uglify())
         .pipe($.uglify())
         .pipe(jsFilter.restore())
         .pipe(jsFilter.restore())
         .pipe(cssFilter)
         .pipe(cssFilter)
-        // .pipe($.csso())
         .pipe(cssFilter.restore())
         .pipe(cssFilter.restore())
         .pipe($.useref.restore())
         .pipe($.useref.restore())
         .pipe($.useref())
         .pipe($.useref())
@@ -63,11 +55,6 @@ gulp.task('views', function() {
 
 
 gulp.task('images', function () {
 gulp.task('images', function () {
     return gulp.src('app/images/**/*')
     return gulp.src('app/images/**/*')
-        .pipe($.cache($.imagemin({
-            optimizationLevel: 3,
-            progressive: true,
-            interlaced: true
-        })))
         .pipe(gulp.dest('dist/images'))
         .pipe(gulp.dest('dist/images'))
         .pipe($.size());
         .pipe($.size());
 });
 });
@@ -94,41 +81,3 @@ gulp.task('build', ['html', 'views', 'images', 'fonts', 'extras']);
 gulp.task('default', ['clean'], function () {
 gulp.task('default', ['clean'], function () {
     gulp.start('build');
     gulp.start('build');
 });
 });
-
-gulp.task('connect', function () {
-    var connect = require('connect');
-    var app = connect()
-        .use(require('connect-livereload')({ port: 35729 }))
-        .use(connect.static('app'))
-        .use(connect.static('.tmp'))
-        .use(connect.directory('app'));
-
-    require('http').createServer(app)
-        .listen(9000)
-        .on('listening', function () {
-            console.log('Started connect web server on http://localhost:9000');
-        });
-});
-
-gulp.task('serve', ['connect'], function () {
-    require('opn')('http://localhost:9000');
-});
-
-gulp.task('watch', ['connect', 'serve'], function () {
-    var server = $.livereload();
-
-    // watch for changes
-
-    gulp.watch([
-        'app/*.html',
-        '.tmp/styles/**/*.css',
-        'app/scripts/**/*.js',
-        'app/images/**/*'
-    ]).on('change', function (file) {
-        server.changed(file.path);
-    });
-
-    gulp.watch('app/styles/**/*.css', ['styles']);
-    gulp.watch('app/scripts/**/*.js', ['scripts']);
-    gulp.watch('app/images/**/*', ['images']);
-});

+ 0 - 9
ambari-admin/src/main/resources/ui/admin-web/package.json

@@ -5,26 +5,17 @@
   },
   },
   "devDependencies": {
   "devDependencies": {
     "bower": "1.3.8",
     "bower": "1.3.8",
-    "connect": "^2.14.4",
-    "connect-livereload": "^0.4.0",
-    "express": "^4.4.5",
     "gulp": "^3.6.0",
     "gulp": "^3.6.0",
     "gulp-autoprefixer": "^0.0.7",
     "gulp-autoprefixer": "^0.0.7",
     "gulp-bower-files": "^0.2.1",
     "gulp-bower-files": "^0.2.1",
     "gulp-cache": "^0.1.1",
     "gulp-cache": "^0.1.1",
     "gulp-clean": "^0.2.4",
     "gulp-clean": "^0.2.4",
-    "gulp-csso": "^0.2.6",
     "gulp-filter": "^0.4.1",
     "gulp-filter": "^0.4.1",
     "gulp-flatten": "^0.0.2",
     "gulp-flatten": "^0.0.2",
-    "gulp-imagemin": "^1.0.1",
-    "gulp-jshint": "^1.5.3",
-    "gulp-livereload": "^1.2.0",
     "gulp-load-plugins": "^0.5.0",
     "gulp-load-plugins": "^0.5.0",
     "gulp-size": "^0.3.0",
     "gulp-size": "^0.3.0",
     "gulp-uglify": "^0.2.1",
     "gulp-uglify": "^0.2.1",
     "gulp-useref": "^0.4.2",
     "gulp-useref": "^0.4.2",
-    "jshint-stylish": "^0.2.0",
-    "opn": "^0.1.1",
     "gulp-plumber": "*"
     "gulp-plumber": "*"
   },
   },
   "engines": {
   "engines": {

+ 6 - 6
ambari-agent/pom.xml

@@ -40,7 +40,7 @@
     <agent.install.dir>/usr/lib/python2.6/site-packages/ambari_agent</agent.install.dir>
     <agent.install.dir>/usr/lib/python2.6/site-packages/ambari_agent</agent.install.dir>
     <ambari_commons.install.dir>/usr/lib/ambari-agent/lib/ambari_commons</ambari_commons.install.dir>
     <ambari_commons.install.dir>/usr/lib/ambari-agent/lib/ambari_commons</ambari_commons.install.dir>
     <resource_management.install.dir>/usr/lib/ambari-agent/lib/resource_management</resource_management.install.dir>
     <resource_management.install.dir>/usr/lib/ambari-agent/lib/resource_management</resource_management.install.dir>
-    <jinja.install.dir>/usr/lib/python2.6/site-packages/jinja2</jinja.install.dir>
+    <jinja.install.dir>/usr/lib/python2.6/site-packages/ambari_jinja2</jinja.install.dir>
     <lib.dir>/usr/lib/ambari-agent/lib</lib.dir>
     <lib.dir>/usr/lib/ambari-agent/lib</lib.dir>
     <python.ver>python &gt;= 2.6</python.ver>
     <python.ver>python &gt;= 2.6</python.ver>
     <deb.python.ver>python (&gt;= 2.6)</deb.python.ver>
     <deb.python.ver>python (&gt;= 2.6)</deb.python.ver>
@@ -115,7 +115,7 @@
                 <argument>unitTests.py</argument>
                 <argument>unitTests.py</argument>
               </arguments>
               </arguments>
               <environmentVariables>
               <environmentVariables>
-                <PYTHONPATH>${project.basedir}/../ambari-common/src/main/python/jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/main/python/resource_management:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/src/main/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files:$PYTHONPATH</PYTHONPATH>
+                <PYTHONPATH>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/main/python/resource_management:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/src/main/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files:$PYTHONPATH</PYTHONPATH>
               </environmentVariables>
               </environmentVariables>
               <skip>${skipTests}</skip>
               <skip>${skipTests}</skip>
             </configuration>
             </configuration>
@@ -255,9 +255,9 @@
               <groupname>root</groupname>
               <groupname>root</groupname>
               <sources>
               <sources>
                 <source>
                 <source>
-                  <location>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2</location>
+                  <location>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2</location>
                   <excludes>
                   <excludes>
-                    <exclude>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2/testsuite</exclude>
+                    <exclude>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite</exclude>
                   </excludes>
                   </excludes>
                 </source>
                 </source>
               </sources>
               </sources>
@@ -413,8 +413,8 @@
               </mapper>
               </mapper>
             </data>
             </data>
             <data>
             <data>
-              <src>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2</src>
-              <excludes>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2/testsuite</excludes>
+              <src>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2</src>
+              <excludes>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite</excludes>
               <type>directory</type>
               <type>directory</type>
               <mapper>
               <mapper>
                 <type>perm</type>
                 <type>perm</type>

+ 1 - 1
ambari-agent/src/main/python/ambari_agent/HostInfo.py

@@ -53,7 +53,7 @@ class HostInfo:
 
 
   # List of live services checked for on the host, takes a map of plan strings
   # List of live services checked for on the host, takes a map of plan strings
   DEFAULT_LIVE_SERVICES = [
   DEFAULT_LIVE_SERVICES = [
-    {OSConst.REDHAT_FAMILY: "ntpd", OSConst.SUSE_FAMILY: "ntp", OSConst.DEBIAN_FAMILY: "ntp"}
+    {OSConst.REDHAT_FAMILY: "ntpd", OSConst.SUSE_FAMILY: "ntp", OSConst.UBUNTU_FAMILY: "ntp"}
   ]
   ]
 
 
   # Set of default users (need to be replaced with the configured user names)
   # Set of default users (need to be replaced with the configured user names)

+ 2 - 2
ambari-agent/src/test/python/ambari_agent/TestHardware.py

@@ -196,10 +196,10 @@ lo        Link encap:Local Loopback
     self.assertEquals(result['operatingsystem'], 'some_type_of_os')
     self.assertEquals(result['operatingsystem'], 'some_type_of_os')
     self.assertEquals(result['osfamily'], 'redhat')
     self.assertEquals(result['osfamily'], 'redhat')
 
 
-    get_os_family_mock.return_value = "debian"
+    get_os_family_mock.return_value = "ubuntu"
     result = Facter().facterInfo()
     result = Facter().facterInfo()
     self.assertEquals(result['operatingsystem'], 'some_type_of_os')
     self.assertEquals(result['operatingsystem'], 'some_type_of_os')
-    self.assertEquals(result['osfamily'], 'debian')
+    self.assertEquals(result['osfamily'], 'ubuntu')
 
 
     get_os_family_mock.return_value = "suse"
     get_os_family_mock.return_value = "suse"
     result = Facter().facterInfo()
     result = Facter().facterInfo()

+ 1 - 1
ambari-agent/src/test/python/resource_management/TestContentSources.py

@@ -27,7 +27,7 @@ from resource_management.core.source import DownloadSource
 from resource_management.core.source import Template
 from resource_management.core.source import Template
 from resource_management.core.source import InlineTemplate
 from resource_management.core.source import InlineTemplate
 
 
-from jinja2 import UndefinedError, TemplateNotFound
+from ambari_jinja2 import UndefinedError, TemplateNotFound
 import urllib2
 import urllib2
 import os
 import os
 
 

+ 4 - 4
ambari-agent/src/test/python/resource_management/TestPackageResource.py

@@ -28,8 +28,8 @@ from resource_management.core import shell
 class TestPackageResource(TestCase):
 class TestPackageResource(TestCase):
   @patch.object(shell, "call")
   @patch.object(shell, "call")
   @patch.object(shell, "checked_call")
   @patch.object(shell, "checked_call")
-  @patch.object(System, "os_family", new = 'debian')
-  def test_action_install_debian_update(self, shell_mock, call_mock):
+  @patch.object(System, "os_family", new = 'ubuntu')
+  def test_action_install_ubuntu_update(self, shell_mock, call_mock):
     call_mock.return_value= (1, None)
     call_mock.return_value= (1, None)
     with Environment('/') as env:
     with Environment('/') as env:
       Package("some_package",
       Package("some_package",
@@ -45,8 +45,8 @@ class TestPackageResource(TestCase):
   
   
   @patch.object(shell, "call")
   @patch.object(shell, "call")
   @patch.object(shell, "checked_call")
   @patch.object(shell, "checked_call")
-  @patch.object(System, "os_family", new = 'debian')
-  def test_action_install_debian(self, shell_mock, call_mock):
+  @patch.object(System, "os_family", new = 'ubuntu')
+  def test_action_install_ubuntu(self, shell_mock, call_mock):
     call_mock.side_effect = [(1, None), (0, None)]
     call_mock.side_effect = [(1, None), (0, None)]
     with Environment('/') as env:
     with Environment('/') as env:
       Package("some_package",
       Package("some_package",

+ 8 - 8
ambari-agent/src/test/python/resource_management/TestRepositoryResource.py

@@ -123,8 +123,8 @@ class TestRepositoryResource(TestCase):
     @patch("os.path.isfile", new=MagicMock(return_value=True))
     @patch("os.path.isfile", new=MagicMock(return_value=True))
     @patch("filecmp.cmp", new=MagicMock(return_value=False))
     @patch("filecmp.cmp", new=MagicMock(return_value=False))
     @patch.object(System, "os_release_name", new='precise')        
     @patch.object(System, "os_release_name", new='precise')        
-    @patch.object(System, "os_family", new='debian')
-    def test_create_repo_debian_repo_exists(self, file_mock, execute_mock, 
+    @patch.object(System, "os_family", new='ubuntu')
+    def test_create_repo_ubuntu_repo_exists(self, file_mock, execute_mock,
                                             tempfile_mock, checked_call_mock):
                                             tempfile_mock, checked_call_mock):
       tempfile_mock.return_value = MagicMock(spec=file)
       tempfile_mock.return_value = MagicMock(spec=file)
       tempfile_mock.return_value.__enter__.return_value.name = "/tmp/1.txt"
       tempfile_mock.return_value.__enter__.return_value.name = "/tmp/1.txt"
@@ -160,8 +160,8 @@ class TestRepositoryResource(TestCase):
     @patch("os.path.isfile", new=MagicMock(return_value=True))
     @patch("os.path.isfile", new=MagicMock(return_value=True))
     @patch("filecmp.cmp", new=MagicMock(return_value=True))
     @patch("filecmp.cmp", new=MagicMock(return_value=True))
     @patch.object(System, "os_release_name", new='precise')        
     @patch.object(System, "os_release_name", new='precise')        
-    @patch.object(System, "os_family", new='debian')
-    def test_create_repo_debian_doesnt_repo_exist(self, file_mock, execute_mock, tempfile_mock):
+    @patch.object(System, "os_family", new='ubuntu')
+    def test_create_repo_ubuntu_doesnt_repo_exist(self, file_mock, execute_mock, tempfile_mock):
       tempfile_mock.return_value = MagicMock(spec=file)
       tempfile_mock.return_value = MagicMock(spec=file)
       tempfile_mock.return_value.__enter__.return_value.name = "/tmp/1.txt"
       tempfile_mock.return_value.__enter__.return_value.name = "/tmp/1.txt"
       
       
@@ -186,10 +186,10 @@ class TestRepositoryResource(TestCase):
       
       
     
     
     @patch("os.path.isfile", new=MagicMock(return_value=True))
     @patch("os.path.isfile", new=MagicMock(return_value=True))
-    @patch.object(System, "os_family", new='debian')
+    @patch.object(System, "os_family", new='ubuntu')
     @patch("resource_management.libraries.providers.repository.Execute")
     @patch("resource_management.libraries.providers.repository.Execute")
     @patch("resource_management.libraries.providers.repository.File")
     @patch("resource_management.libraries.providers.repository.File")
-    def test_remove_repo_debian_repo_exist(self, file_mock, execute_mock):
+    def test_remove_repo_ubuntu_repo_exist(self, file_mock, execute_mock):
       with Environment('/') as env:
       with Environment('/') as env:
           Repository('HDP',
           Repository('HDP',
                      action = "remove",
                      action = "remove",
@@ -200,10 +200,10 @@ class TestRepositoryResource(TestCase):
       self.assertEqual(execute_mock.call_args[0][0], 'apt-get update -qq -o Dir::Etc::sourcelist="sources.list.d/HDP.list" -o APT::Get::List-Cleanup="0"')
       self.assertEqual(execute_mock.call_args[0][0], 'apt-get update -qq -o Dir::Etc::sourcelist="sources.list.d/HDP.list" -o APT::Get::List-Cleanup="0"')
 
 
     @patch("os.path.isfile", new=MagicMock(return_value=False))
     @patch("os.path.isfile", new=MagicMock(return_value=False))
-    @patch.object(System, "os_family", new='debian')
+    @patch.object(System, "os_family", new='ubuntu')
     @patch("resource_management.libraries.providers.repository.Execute")
     @patch("resource_management.libraries.providers.repository.Execute")
     @patch("resource_management.libraries.providers.repository.File")
     @patch("resource_management.libraries.providers.repository.File")
-    def test_remove_repo_debian_repo_doenst_exist(self, file_mock, execute_mock):
+    def test_remove_repo_ubuntu_repo_doenst_exist(self, file_mock, execute_mock):
       with Environment('/') as env:
       with Environment('/') as env:
           Repository('HDP',
           Repository('HDP',
                      action = "remove",
                      action = "remove",

+ 4 - 4
ambari-common/src/main/python/ambari_commons/os_check.py

@@ -37,7 +37,7 @@ def linux_distribution():
 class OS_CONST_TYPE(type):
 class OS_CONST_TYPE(type):
   # os families
   # os families
   REDHAT_FAMILY = 'redhat'
   REDHAT_FAMILY = 'redhat'
-  DEBIAN_FAMILY = 'debian'
+  UBUNTU_FAMILY = 'ubuntu'
   SUSE_FAMILY = 'suse'
   SUSE_FAMILY = 'suse'
 
 
   # Declare here os type mapping
   # Declare here os type mapping
@@ -49,7 +49,7 @@ class OS_CONST_TYPE(type):
                                  'cloudlinux', 'slc', 'scientific', 'psbm',
                                  'cloudlinux', 'slc', 'scientific', 'psbm',
                                  'centos linux']
                                  'centos linux']
                              },
                              },
-                            {'name': DEBIAN_FAMILY,
+                            {'name': UBUNTU_FAMILY,
                              'os_list': ['ubuntu', 'debian']
                              'os_list': ['ubuntu', 'debian']
                              },
                              },
                             {'name': SUSE_FAMILY,
                             {'name': SUSE_FAMILY,
@@ -172,14 +172,14 @@ class OSCheck:
   #  Exception safe family check functions
   #  Exception safe family check functions
 
 
   @staticmethod
   @staticmethod
-  def is_debian_family():
+  def is_ubuntu_family():
     """
     """
      Return true if it is so or false if not
      Return true if it is so or false if not
 
 
      This is safe check for debian family, doesn't generate exception
      This is safe check for debian family, doesn't generate exception
     """
     """
     try:
     try:
-      if OSCheck.get_os_family() == OSConst.DEBIAN_FAMILY:
+      if OSCheck.get_os_family() == OSConst.UBUNTU_FAMILY:
         return True
         return True
     except Exception:
     except Exception:
       pass
       pass

+ 0 - 0
ambari-common/src/main/python/jinja2/AUTHORS → ambari-common/src/main/python/ambari_jinja2/AUTHORS


+ 2 - 2
ambari-common/src/main/python/jinja2/CHANGES → ambari-common/src/main/python/ambari_jinja2/CHANGES

@@ -205,7 +205,7 @@ Version 2.0
   slightly.  It's now possible to give attributes or items a higher priority
   slightly.  It's now possible to give attributes or items a higher priority
   by either using dot-notation lookup or the bracket syntax.  This also
   by either using dot-notation lookup or the bracket syntax.  This also
   changed the AST slightly.  `Subscript` is gone and was replaced with
   changed the AST slightly.  `Subscript` is gone and was replaced with
-  :class:`~jinja2.nodes.Getitem` and :class:`~jinja2.nodes.Getattr`.
+  :class:`~ambari_jinja2.nodes.Getitem` and :class:`~ambari_jinja2.nodes.Getattr`.
 
 
   For more information see :ref:`the implementation details <notes-on-subscriptions>`.
   For more information see :ref:`the implementation details <notes-on-subscriptions>`.
 
 
@@ -213,7 +213,7 @@ Version 2.0
   This would allow extensions to allow simplified gettext calls in template
   This would allow extensions to allow simplified gettext calls in template
   data and something similar.
   data and something similar.
 
 
-- added :meth:`jinja2.environment.TemplateStream.dump`.
+- added :meth:`ambari_jinja2.environment.TemplateStream.dump`.
 
 
 - added missing support for implicit string literal concatenation.
 - added missing support for implicit string literal concatenation.
   ``{{ "foo" "bar" }}`` is equivalent to ``{{ "foobar" }}``
   ``{{ "foo" "bar" }}`` is equivalent to ``{{ "foobar" }}``

+ 0 - 0
ambari-common/src/main/python/jinja2/LICENSE → ambari-common/src/main/python/ambari_jinja2/LICENSE


+ 4 - 4
ambari-common/src/main/python/jinja2/MANIFEST.in → ambari-common/src/main/python/ambari_jinja2/MANIFEST.in

@@ -1,12 +1,12 @@
-include MANIFEST.in Makefile CHANGES LICENSE AUTHORS jinja2/_debugsupport.c
+include MANIFEST.in Makefile CHANGES LICENSE AUTHORS ambari_jinja2/_debugsupport.c
 recursive-include docs *
 recursive-include docs *
 recursive-include custom_fixers *
 recursive-include custom_fixers *
 recursive-include ext *
 recursive-include ext *
 recursive-include artwork *
 recursive-include artwork *
 recursive-include examples *
 recursive-include examples *
-recursive-include jinja2/testsuite/res *
+recursive-include ambari_jinja2/testsuite/res *
 recursive-exclude docs/_build *
 recursive-exclude docs/_build *
-recursive-exclude jinja2 *.pyc
+recursive-exclude ambari_jinja2 *.pyc
 recursive-exclude docs *.pyc
 recursive-exclude docs *.pyc
-recursive-exclude jinja2 *.pyo
+recursive-exclude ambari_jinja2 *.pyo
 recursive-exclude docs *.pyo
 recursive-exclude docs *.pyo

+ 0 - 0
ambari-common/src/main/python/jinja2/Makefile → ambari-common/src/main/python/ambari_jinja2/Makefile


+ 8 - 8
ambari-common/src/main/python/jinja2/jinja2/__init__.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/__init__.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2
+    ambari_jinja2
     ~~~~~~
     ~~~~~~
 
 
     Jinja2 is a template engine written in pure Python.  It provides a
     Jinja2 is a template engine written in pure Python.  It provides a
@@ -34,29 +34,29 @@ except:
     __version__ = 'unknown'
     __version__ = 'unknown'
 
 
 # high level interface
 # high level interface
-from jinja2.environment import Environment, Template
+from ambari_jinja2.environment import Environment, Template
 
 
 # loaders
 # loaders
-from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
+from ambari_jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
      DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
      DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
      ModuleLoader
      ModuleLoader
 
 
 # bytecode caches
 # bytecode caches
-from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
+from ambari_jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
      MemcachedBytecodeCache
      MemcachedBytecodeCache
 
 
 # undefined types
 # undefined types
-from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
+from ambari_jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
 
 
 # exceptions
 # exceptions
-from jinja2.exceptions import TemplateError, UndefinedError, \
+from ambari_jinja2.exceptions import TemplateError, UndefinedError, \
      TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
      TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
      TemplateAssertionError
      TemplateAssertionError
 
 
 # decorators and public utilities
 # decorators and public utilities
-from jinja2.filters import environmentfilter, contextfilter, \
+from ambari_jinja2.filters import environmentfilter, contextfilter, \
      evalcontextfilter
      evalcontextfilter
-from jinja2.utils import Markup, escape, clear_caches, \
+from ambari_jinja2.utils import Markup, escape, clear_caches, \
      environmentfunction, evalcontextfunction, contextfunction, \
      environmentfunction, evalcontextfunction, contextfunction, \
      is_undefined
      is_undefined
 
 

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/_debugsupport.c → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_debugsupport.c

@@ -1,5 +1,5 @@
 /**
 /**
- * jinja2._debugsupport
+ * ambari_jinja2._debugsupport
  * ~~~~~~~~~~~~~~~~~~~~
  * ~~~~~~~~~~~~~~~~~~~~
  *
  *
  * C implementation of `tb_set_next`.
  * C implementation of `tb_set_next`.
@@ -52,14 +52,14 @@ static PyMethodDef module_methods[] = {
 PyMODINIT_FUNC
 PyMODINIT_FUNC
 init_debugsupport(void)
 init_debugsupport(void)
 {
 {
-	Py_InitModule3("jinja2._debugsupport", module_methods, "");
+	Py_InitModule3("ambari_jinja2._debugsupport", module_methods, "");
 }
 }
 
 
 #else /* Python 3.x module initialization */
 #else /* Python 3.x module initialization */
 
 
 static struct PyModuleDef module_definition = {
 static struct PyModuleDef module_definition = {
         PyModuleDef_HEAD_INIT,
         PyModuleDef_HEAD_INIT,
-	"jinja2._debugsupport",
+	"ambari_jinja2._debugsupport",
 	NULL,
 	NULL,
 	-1,
 	-1,
 	module_methods,
 	module_methods,

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/__init__.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/__init__.py

@@ -126,7 +126,7 @@ class Markup(unicode):
         >>> Markup("Main &raquo; <em>About</em>").unescape()
         >>> Markup("Main &raquo; <em>About</em>").unescape()
         u'Main \xbb <em>About</em>'
         u'Main \xbb <em>About</em>'
         """
         """
-        from jinja2._markupsafe._constants import HTML_ENTITIES
+        from ambari_jinja2._markupsafe._constants import HTML_ENTITIES
         def handle_match(m):
         def handle_match(m):
             name = m.group(1)
             name = m.group(1)
             if name in HTML_ENTITIES:
             if name in HTML_ENTITIES:
@@ -220,6 +220,6 @@ class _MarkupEscapeHelper(object):
 # we have to import it down here as the speedups and native
 # we have to import it down here as the speedups and native
 # modules imports the markup type which is define above.
 # modules imports the markup type which is define above.
 try:
 try:
-    from jinja2._markupsafe._speedups import escape, escape_silent, soft_unicode
+    from ambari_jinja2._markupsafe._speedups import escape, escape_silent, soft_unicode
 except ImportError:
 except ImportError:
-    from jinja2._markupsafe._native import escape, escape_silent, soft_unicode
+    from ambari_jinja2._markupsafe._native import escape, escape_silent, soft_unicode

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/_bundle.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_bundle.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2._markupsafe._bundle
+    ambari_jinja2._markupsafe._bundle
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     This script pulls in markupsafe from a source folder and
     This script pulls in markupsafe from a source folder and
@@ -18,7 +18,7 @@ import re
 def rewrite_imports(lines):
 def rewrite_imports(lines):
     for idx, line in enumerate(lines):
     for idx, line in enumerate(lines):
         new_line = re.sub(r'(import|from)\s+markupsafe\b',
         new_line = re.sub(r'(import|from)\s+markupsafe\b',
-                          r'\1 jinja2._markupsafe', line)
+                          r'\1 ambari_jinja2._markupsafe', line)
         if new_line != line:
         if new_line != line:
             lines[idx] = new_line
             lines[idx] = new_line
 
 

+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/_constants.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_constants.py


+ 1 - 1
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/_native.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/_native.py

@@ -8,7 +8,7 @@
     :copyright: (c) 2010 by Armin Ronacher.
     :copyright: (c) 2010 by Armin Ronacher.
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
 """
 """
-from jinja2._markupsafe import Markup
+from ambari_jinja2._markupsafe import Markup
 
 
 
 
 def escape(s):
 def escape(s):

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/_markupsafe/tests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_markupsafe/tests.py

@@ -1,6 +1,6 @@
 import gc
 import gc
 import unittest
 import unittest
-from jinja2._markupsafe import Markup, escape, escape_silent
+from ambari_jinja2._markupsafe import Markup, escape, escape_silent
 
 
 
 
 class MarkupTestCase(unittest.TestCase):
 class MarkupTestCase(unittest.TestCase):
@@ -41,7 +41,7 @@ class MarkupTestCase(unittest.TestCase):
         assert Markup("&lt;test&gt;").unescape() == "<test>"
         assert Markup("&lt;test&gt;").unescape() == "<test>"
 
 
     def test_all_set(self):
     def test_all_set(self):
-        import jinja2._markupsafe as markup
+        import ambari_jinja2._markupsafe as markup
         for item in markup.__all__:
         for item in markup.__all__:
             getattr(markup, item)
             getattr(markup, item)
 
 

+ 1 - 1
ambari-common/src/main/python/jinja2/jinja2/_stringdefs.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/_stringdefs.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2._stringdefs
+    ambari_jinja2._stringdefs
     ~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~
 
 
     Strings of all Unicode characters of a certain category.
     Strings of all Unicode characters of a certain category.

+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/bccache.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/bccache.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.bccache
+    ambari_jinja2.bccache
     ~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~
 
 
     This module implements the bytecode cache system Jinja is optionally
     This module implements the bytecode cache system Jinja is optionally
@@ -24,7 +24,7 @@ try:
     from hashlib import sha1
     from hashlib import sha1
 except ImportError:
 except ImportError:
     from sha import new as sha1
     from sha import new as sha1
-from jinja2.utils import open_if_exists
+from ambari_jinja2.utils import open_if_exists
 
 
 
 
 bc_version = 1
 bc_version = 1
@@ -94,7 +94,7 @@ class Bucket(object):
 class BytecodeCache(object):
 class BytecodeCache(object):
     """To implement your own bytecode cache you have to subclass this class
     """To implement your own bytecode cache you have to subclass this class
     and override :meth:`load_bytecode` and :meth:`dump_bytecode`.  Both of
     and override :meth:`load_bytecode` and :meth:`dump_bytecode`.  Both of
-    these methods are passed a :class:`~jinja2.bccache.Bucket`.
+    these methods are passed a :class:`~ambari_jinja2.bccache.Bucket`.
 
 
     A very basic bytecode cache that saves the bytecode on the file system::
     A very basic bytecode cache that saves the bytecode on the file system::
 
 
@@ -176,7 +176,7 @@ class FileSystemBytecodeCache(BytecodeCache):
     If no directory is specified the system temporary items folder is used.
     If no directory is specified the system temporary items folder is used.
 
 
     The pattern can be used to have multiple separate caches operate on the
     The pattern can be used to have multiple separate caches operate on the
-    same directory.  The default pattern is ``'__jinja2_%s.cache'``.  ``%s``
+    same directory.  The default pattern is ``'__ambari_jinja2_%s.cache'``.  ``%s``
     is replaced with the cache key.
     is replaced with the cache key.
 
 
     >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')
     >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')
@@ -184,7 +184,7 @@ class FileSystemBytecodeCache(BytecodeCache):
     This bytecode cache supports clearing of the cache using the clear method.
     This bytecode cache supports clearing of the cache using the clear method.
     """
     """
 
 
-    def __init__(self, directory=None, pattern='__jinja2_%s.cache'):
+    def __init__(self, directory=None, pattern='__ambari_jinja2_%s.cache'):
         if directory is None:
         if directory is None:
             directory = tempfile.gettempdir()
             directory = tempfile.gettempdir()
         self.directory = directory
         self.directory = directory
@@ -263,7 +263,7 @@ class MemcachedBytecodeCache(BytecodeCache):
     The clear method is a no-operation function.
     The clear method is a no-operation function.
     """
     """
 
 
-    def __init__(self, client, prefix='jinja2/bytecode/', timeout=None):
+    def __init__(self, client, prefix='ambari_jinja2/bytecode/', timeout=None):
         self.client = client
         self.client = client
         self.prefix = prefix
         self.prefix = prefix
         self.timeout = timeout
         self.timeout = timeout

+ 8 - 8
ambari-common/src/main/python/jinja2/jinja2/compiler.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/compiler.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.compiler
+    ambari_jinja2.compiler
     ~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~
 
 
     Compiles nodes into python code.
     Compiles nodes into python code.
@@ -11,11 +11,11 @@
 from cStringIO import StringIO
 from cStringIO import StringIO
 from itertools import chain
 from itertools import chain
 from copy import deepcopy
 from copy import deepcopy
-from jinja2 import nodes
-from jinja2.nodes import EvalContext
-from jinja2.visitor import NodeVisitor, NodeTransformer
-from jinja2.exceptions import TemplateAssertionError
-from jinja2.utils import Markup, concat, escape, is_python_keyword, next
+from ambari_jinja2 import nodes
+from ambari_jinja2.nodes import EvalContext
+from ambari_jinja2.visitor import NodeVisitor, NodeTransformer
+from ambari_jinja2.exceptions import TemplateAssertionError
+from ambari_jinja2.utils import Markup, concat, escape, is_python_keyword, next
 
 
 
 
 operators = {
 operators = {
@@ -763,9 +763,9 @@ class CodeGenerator(NodeVisitor):
         assert frame is None, 'no root frame allowed'
         assert frame is None, 'no root frame allowed'
         eval_ctx = EvalContext(self.environment, self.name)
         eval_ctx = EvalContext(self.environment, self.name)
 
 
-        from jinja2.runtime import __all__ as exported
+        from ambari_jinja2.runtime import __all__ as exported
         self.writeline('from __future__ import division')
         self.writeline('from __future__ import division')
-        self.writeline('from jinja2.runtime import ' + ', '.join(exported))
+        self.writeline('from ambari_jinja2.runtime import ' + ', '.join(exported))
         if not unoptimize_before_dead_code:
         if not unoptimize_before_dead_code:
             self.writeline('dummy = lambda *x: None')
             self.writeline('dummy = lambda *x: None')
 
 

+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/constants.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/constants.py


+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/debug.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/debug.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.debug
+    ambari_jinja2.debug
     ~~~~~~~~~~~~
     ~~~~~~~~~~~~
 
 
     Implements the debug interface for Jinja.  This module does some pretty
     Implements the debug interface for Jinja.  This module does some pretty
@@ -12,8 +12,8 @@
 """
 """
 import sys
 import sys
 import traceback
 import traceback
-from jinja2.utils import CodeType, missing, internal_code
-from jinja2.exceptions import TemplateSyntaxError
+from ambari_jinja2.utils import CodeType, missing, internal_code
+from ambari_jinja2.exceptions import TemplateSyntaxError
 
 
 
 
 # how does the raise helper look like?
 # how does the raise helper look like?
@@ -76,7 +76,7 @@ class ProcessedTraceback(object):
 
 
     def render_as_html(self, full=False):
     def render_as_html(self, full=False):
         """Return a unicode string with the traceback as rendered HTML."""
         """Return a unicode string with the traceback as rendered HTML."""
-        from jinja2.debugrenderer import render_traceback
+        from ambari_jinja2.debugrenderer import render_traceback
         return u'%s\n\n<!--\n%s\n-->' % (
         return u'%s\n\n<!--\n%s\n-->' % (
             render_traceback(self, full=full),
             render_traceback(self, full=full),
             self.render_as_text().decode('utf-8', 'replace')
             self.render_as_text().decode('utf-8', 'replace')
@@ -299,7 +299,7 @@ def _init_ugly_crap():
 
 
 # try to get a tb_set_next implementation
 # try to get a tb_set_next implementation
 try:
 try:
-    from jinja2._debugsupport import tb_set_next
+    from ambari_jinja2._debugsupport import tb_set_next
 except ImportError:
 except ImportError:
     try:
     try:
         tb_set_next = _init_ugly_crap()
         tb_set_next = _init_ugly_crap()

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/defaults.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/defaults.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.defaults
+    ambari_jinja2.defaults
     ~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~
 
 
     Jinja default filters and tags.
     Jinja default filters and tags.
@@ -8,7 +8,7 @@
     :copyright: (c) 2010 by the Jinja Team.
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
 """
 """
-from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
+from ambari_jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
 
 
 
 
 # defaults for the parser / lexer
 # defaults for the parser / lexer
@@ -25,8 +25,8 @@ NEWLINE_SEQUENCE = '\n'
 
 
 
 
 # default filters, tests and namespace
 # default filters, tests and namespace
-from jinja2.filters import FILTERS as DEFAULT_FILTERS
-from jinja2.tests import TESTS as DEFAULT_TESTS
+from ambari_jinja2.filters import FILTERS as DEFAULT_FILTERS
+from ambari_jinja2.tests import TESTS as DEFAULT_TESTS
 DEFAULT_NAMESPACE = {
 DEFAULT_NAMESPACE = {
     'range':        xrange,
     'range':        xrange,
     'dict':         lambda **kw: kw,
     'dict':         lambda **kw: kw,

+ 16 - 16
ambari-common/src/main/python/jinja2/jinja2/environment.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/environment.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.environment
+    ambari_jinja2.environment
     ~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~
 
 
     Provides a class that holds runtime and parsing time options.
     Provides a class that holds runtime and parsing time options.
@@ -10,16 +10,16 @@
 """
 """
 import os
 import os
 import sys
 import sys
-from jinja2 import nodes
-from jinja2.defaults import *
-from jinja2.lexer import get_lexer, TokenStream
-from jinja2.parser import Parser
-from jinja2.optimizer import optimize
-from jinja2.compiler import generate
-from jinja2.runtime import Undefined, new_context
-from jinja2.exceptions import TemplateSyntaxError, TemplateNotFound, \
+from ambari_jinja2 import nodes
+from ambari_jinja2.defaults import *
+from ambari_jinja2.lexer import get_lexer, TokenStream
+from ambari_jinja2.parser import Parser
+from ambari_jinja2.optimizer import optimize
+from ambari_jinja2.compiler import generate
+from ambari_jinja2.runtime import Undefined, new_context
+from ambari_jinja2.exceptions import TemplateSyntaxError, TemplateNotFound, \
      TemplatesNotFound
      TemplatesNotFound
-from jinja2.utils import import_string, LRUCache, Markup, missing, \
+from ambari_jinja2.utils import import_string, LRUCache, Markup, missing, \
      concat, consume, internalcode, _encode_filename
      concat, consume, internalcode, _encode_filename
 
 
 
 
@@ -160,7 +160,7 @@ class Environment(object):
         `autoescape`
         `autoescape`
             If set to true the XML/HTML autoescaping feature is enabled by
             If set to true the XML/HTML autoescaping feature is enabled by
             default.  For more details about auto escaping see
             default.  For more details about auto escaping see
-            :class:`~jinja2.utils.Markup`.  As of Jinja 2.4 this can also
+            :class:`~ambari_jinja2.utils.Markup`.  As of Jinja 2.4 this can also
             be a callable that is passed the template name and has to
             be a callable that is passed the template name and has to
             return `True` or `False` depending on autoescape should be
             return `True` or `False` depending on autoescape should be
             enabled by default.
             enabled by default.
@@ -196,7 +196,7 @@ class Environment(object):
 
 
     #: if this environment is sandboxed.  Modifying this variable won't make
     #: if this environment is sandboxed.  Modifying this variable won't make
     #: the environment sandboxed though.  For a real sandboxed environment
     #: the environment sandboxed though.  For a real sandboxed environment
-    #: have a look at jinja2.sandbox
+    #: have a look at ambari_jinja2.sandbox
     sandboxed = False
     sandboxed = False
 
 
     #: True if the environment is just an overlay
     #: True if the environment is just an overlay
@@ -423,7 +423,7 @@ class Environment(object):
 
 
     def _tokenize(self, source, name, filename=None, state=None):
     def _tokenize(self, source, name, filename=None, state=None):
         """Called by the parser to do the preprocessing and filtering
         """Called by the parser to do the preprocessing and filtering
-        for all the extensions.  Returns a :class:`~jinja2.lexer.TokenStream`.
+        for all the extensions.  Returns a :class:`~ambari_jinja2.lexer.TokenStream`.
         """
         """
         source = self.preprocess(source, name, filename)
         source = self.preprocess(source, name, filename)
         stream = self.lexer.tokenize(source, name, filename, state)
         stream = self.lexer.tokenize(source, name, filename, state)
@@ -559,7 +559,7 @@ class Environment(object):
 
 
         .. versionadded:: 2.4
         .. versionadded:: 2.4
         """
         """
-        from jinja2.loaders import ModuleLoader
+        from ambari_jinja2.loaders import ModuleLoader
 
 
         if log_function is None:
         if log_function is None:
             log_function = lambda x: None
             log_function = lambda x: None
@@ -657,7 +657,7 @@ class Environment(object):
         # get any exceptions in template rendering there is no need to load
         # get any exceptions in template rendering there is no need to load
         # all of that.
         # all of that.
         if _make_traceback is None:
         if _make_traceback is None:
-            from jinja2.debug import make_traceback as _make_traceback
+            from ambari_jinja2.debug import make_traceback as _make_traceback
         traceback = _make_traceback(exc_info, source_hint)
         traceback = _make_traceback(exc_info, source_hint)
         if rendered and self.exception_formatter is not None:
         if rendered and self.exception_formatter is not None:
             return self.exception_formatter(traceback)
             return self.exception_formatter(traceback)
@@ -1014,7 +1014,7 @@ class TemplateModule(object):
 
 
 
 
 class TemplateExpression(object):
 class TemplateExpression(object):
-    """The :meth:`jinja2.Environment.compile_expression` method returns an
+    """The :meth:`ambari_jinja2.Environment.compile_expression` method returns an
     instance of this object.  It encapsulates the expression-like access
     instance of this object.  It encapsulates the expression-like access
     to the template with an expression it wraps.
     to the template with an expression it wraps.
     """
     """

+ 1 - 1
ambari-common/src/main/python/jinja2/jinja2/exceptions.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/exceptions.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.exceptions
+    ambari_jinja2.exceptions
     ~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~
 
 
     Jinja exceptions.
     Jinja exceptions.

+ 12 - 12
ambari-common/src/main/python/jinja2/jinja2/ext.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/ext.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.ext
+    ambari_jinja2.ext
     ~~~~~~~~~~
     ~~~~~~~~~~
 
 
     Jinja extensions allow to add custom tags similar to the way django custom
     Jinja extensions allow to add custom tags similar to the way django custom
@@ -11,12 +11,12 @@
     :license: BSD.
     :license: BSD.
 """
 """
 from collections import deque
 from collections import deque
-from jinja2 import nodes
-from jinja2.defaults import *
-from jinja2.environment import Environment
-from jinja2.runtime import Undefined, concat
-from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError
-from jinja2.utils import contextfunction, import_string, Markup, next
+from ambari_jinja2 import nodes
+from ambari_jinja2.defaults import *
+from ambari_jinja2.environment import Environment
+from ambari_jinja2.runtime import Undefined, concat
+from ambari_jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError
+from ambari_jinja2.utils import contextfunction, import_string, Markup, next
 
 
 
 
 # the only real useful gettext functions for a Jinja template.  Note
 # the only real useful gettext functions for a Jinja template.  Note
@@ -82,10 +82,10 @@ class Extension(object):
         return source
         return source
 
 
     def filter_stream(self, stream):
     def filter_stream(self, stream):
-        """It's passed a :class:`~jinja2.lexer.TokenStream` that can be used
+        """It's passed a :class:`~ambari_jinja2.lexer.TokenStream` that can be used
         to filter tokens returned.  This method has to return an iterable of
         to filter tokens returned.  This method has to return an iterable of
-        :class:`~jinja2.lexer.Token`\s, but it doesn't have to return a
-        :class:`~jinja2.lexer.TokenStream`.
+        :class:`~ambari_jinja2.lexer.Token`\s, but it doesn't have to return a
+        :class:`~ambari_jinja2.lexer.TokenStream`.
 
 
         In the `ext` folder of the Jinja2 source distribution there is a file
         In the `ext` folder of the Jinja2 source distribution there is a file
         called `inlinegettext.py` which implements a filter that utilizes this
         called `inlinegettext.py` which implements a filter that utilizes this
@@ -112,7 +112,7 @@ class Extension(object):
     def call_method(self, name, args=None, kwargs=None, dyn_args=None,
     def call_method(self, name, args=None, kwargs=None, dyn_args=None,
                     dyn_kwargs=None, lineno=None):
                     dyn_kwargs=None, lineno=None):
         """Call a method of the extension.  This is a shortcut for
         """Call a method of the extension.  This is a shortcut for
-        :meth:`attr` + :class:`jinja2.nodes.Call`.
+        :meth:`attr` + :class:`ambari_jinja2.nodes.Call`.
         """
         """
         if args is None:
         if args is None:
             args = []
             args = []
@@ -445,7 +445,7 @@ def extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS,
 
 
     This example explains the behavior:
     This example explains the behavior:
 
 
-    >>> from jinja2 import Environment
+    >>> from ambari_jinja2 import Environment
     >>> env = Environment()
     >>> env = Environment()
     >>> node = env.parse('{{ (_("foo"), _(), ngettext("foo", "bar", 42)) }}')
     >>> node = env.parse('{{ (_("foo"), _(), ngettext("foo", "bar", 42)) }}')
     >>> list(extract_from_ast(node))
     >>> list(extract_from_ast(node))

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/filters.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/filters.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.filters
+    ambari_jinja2.filters
     ~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~
 
 
     Bundled jinja filters.
     Bundled jinja filters.
@@ -13,9 +13,9 @@ import math
 from random import choice
 from random import choice
 from operator import itemgetter
 from operator import itemgetter
 from itertools import imap, groupby
 from itertools import imap, groupby
-from jinja2.utils import Markup, escape, pformat, urlize, soft_unicode
-from jinja2.runtime import Undefined
-from jinja2.exceptions import FilterArgumentError, SecurityError
+from ambari_jinja2.utils import Markup, escape, pformat, urlize, soft_unicode
+from ambari_jinja2.runtime import Undefined
+from ambari_jinja2.exceptions import FilterArgumentError, SecurityError
 
 
 
 
 _word_re = re.compile(r'\w+(?u)')
 _word_re = re.compile(r'\w+(?u)')

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/lexer.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/lexer.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.lexer
+    ambari_jinja2.lexer
     ~~~~~~~~~~~~
     ~~~~~~~~~~~~
 
 
     This module implements a Jinja / Python combination lexer. The
     This module implements a Jinja / Python combination lexer. The
@@ -17,8 +17,8 @@
 import re
 import re
 from operator import itemgetter
 from operator import itemgetter
 from collections import deque
 from collections import deque
-from jinja2.exceptions import TemplateSyntaxError
-from jinja2.utils import LRUCache, next
+from ambari_jinja2.exceptions import TemplateSyntaxError
+from ambari_jinja2.utils import LRUCache, next
 
 
 
 
 # cache for the lexers. Exists in order to be able to have multiple
 # cache for the lexers. Exists in order to be able to have multiple
@@ -38,7 +38,7 @@ try:
 except SyntaxError:
 except SyntaxError:
     name_re = re.compile(r'\b[a-zA-Z_][a-zA-Z0-9_]*\b')
     name_re = re.compile(r'\b[a-zA-Z_][a-zA-Z0-9_]*\b')
 else:
 else:
-    from jinja2 import _stringdefs
+    from ambari_jinja2 import _stringdefs
     name_re = re.compile(r'[%s][%s]*' % (_stringdefs.xid_start,
     name_re = re.compile(r'[%s][%s]*' % (_stringdefs.xid_start,
                                          _stringdefs.xid_continue))
                                          _stringdefs.xid_continue))
 
 
@@ -353,7 +353,7 @@ class TokenStream(object):
 
 
     def expect(self, expr):
     def expect(self, expr):
         """Expect a given token type and return it.  This accepts the same
         """Expect a given token type and return it.  This accepts the same
-        argument as :meth:`jinja2.lexer.Token.test`.
+        argument as :meth:`ambari_jinja2.lexer.Token.test`.
         """
         """
         if not self.current.test(expr):
         if not self.current.test(expr):
             expr = describe_token_expr(expr)
             expr = describe_token_expr(expr)

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/loaders.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/loaders.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.loaders
+    ambari_jinja2.loaders
     ~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~
 
 
     Jinja loader classes.
     Jinja loader classes.
@@ -17,8 +17,8 @@ try:
     from hashlib import sha1
     from hashlib import sha1
 except ImportError:
 except ImportError:
     from sha import new as sha1
     from sha import new as sha1
-from jinja2.exceptions import TemplateNotFound
-from jinja2.utils import LRUCache, open_if_exists, internalcode
+from ambari_jinja2.exceptions import TemplateNotFound
+from ambari_jinja2.utils import LRUCache, open_if_exists, internalcode
 
 
 
 
 def split_template_path(template):
 def split_template_path(template):
@@ -45,7 +45,7 @@ class BaseLoader(object):
     A very basic example for a loader that looks up templates on the file
     A very basic example for a loader that looks up templates on the file
     system could look like this::
     system could look like this::
 
 
-        from jinja2 import BaseLoader, TemplateNotFound
+        from ambari_jinja2 import BaseLoader, TemplateNotFound
         from os.path import join, exists, getmtime
         from os.path import join, exists, getmtime
 
 
         class MyLoader(BaseLoader):
         class MyLoader(BaseLoader):
@@ -402,7 +402,7 @@ class ModuleLoader(BaseLoader):
     has_source_access = False
     has_source_access = False
 
 
     def __init__(self, path):
     def __init__(self, path):
-        package_name = '_jinja2_module_templates_%x' % id(self)
+        package_name = '_ambari_jinja2_module_templates_%x' % id(self)
 
 
         # create a fake module that looks for the templates in the
         # create a fake module that looks for the templates in the
         # path given.
         # path given.

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/meta.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/meta.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.meta
+    ambari_jinja2.meta
     ~~~~~~~~~~~
     ~~~~~~~~~~~
 
 
     This module implements various functions that exposes information about
     This module implements various functions that exposes information about
@@ -9,8 +9,8 @@
     :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
     :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
 """
 """
-from jinja2 import nodes
-from jinja2.compiler import CodeGenerator
+from ambari_jinja2 import nodes
+from ambari_jinja2.compiler import CodeGenerator
 
 
 
 
 class TrackingCodeGenerator(CodeGenerator):
 class TrackingCodeGenerator(CodeGenerator):
@@ -35,7 +35,7 @@ def find_undeclared_variables(ast):
     variables will be used depending on the path the execution takes at
     variables will be used depending on the path the execution takes at
     runtime, all variables are returned.
     runtime, all variables are returned.
 
 
-    >>> from jinja2 import Environment, meta
+    >>> from ambari_jinja2 import Environment, meta
     >>> env = Environment()
     >>> env = Environment()
     >>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
     >>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
     >>> meta.find_undeclared_variables(ast)
     >>> meta.find_undeclared_variables(ast)
@@ -59,7 +59,7 @@ def find_referenced_templates(ast):
     imports.  If dynamic inheritance or inclusion is used, `None` will be
     imports.  If dynamic inheritance or inclusion is used, `None` will be
     yielded.
     yielded.
 
 
-    >>> from jinja2 import Environment, meta
+    >>> from ambari_jinja2 import Environment, meta
     >>> env = Environment()
     >>> env = Environment()
     >>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
     >>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
     >>> list(meta.find_referenced_templates(ast))
     >>> list(meta.find_referenced_templates(ast))

+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/nodes.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/nodes.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.nodes
+    ambari_jinja2.nodes
     ~~~~~~~~~~~~
     ~~~~~~~~~~~~
 
 
     This module implements additional nodes derived from the ast base node.
     This module implements additional nodes derived from the ast base node.
@@ -15,7 +15,7 @@
 import operator
 import operator
 from itertools import chain, izip
 from itertools import chain, izip
 from collections import deque
 from collections import deque
-from jinja2.utils import Markup, MethodType, FunctionType
+from ambari_jinja2.utils import Markup, MethodType, FunctionType
 
 
 
 
 #: the types we support for context functions
 #: the types we support for context functions
@@ -795,7 +795,7 @@ class ExtensionAttribute(Expr):
     The identifier is the identifier of the :class:`Extension`.
     The identifier is the identifier of the :class:`Extension`.
 
 
     This node is usually constructed by calling the
     This node is usually constructed by calling the
-    :meth:`~jinja2.ext.Extension.attr` method on an extension.
+    :meth:`~ambari_jinja2.ext.Extension.attr` method on an extension.
     """
     """
     fields = ('identifier', 'name')
     fields = ('identifier', 'name')
 
 
@@ -812,7 +812,7 @@ class ImportedName(Expr):
 class InternalName(Expr):
 class InternalName(Expr):
     """An internal name in the compiler.  You cannot create these nodes
     """An internal name in the compiler.  You cannot create these nodes
     yourself but the parser provides a
     yourself but the parser provides a
-    :meth:`~jinja2.parser.Parser.free_identifier` method that creates
+    :meth:`~ambari_jinja2.parser.Parser.free_identifier` method that creates
     a new identifier for you.  This identifier is not available from the
     a new identifier for you.  This identifier is not available from the
     template and is not threated specially by the compiler.
     template and is not threated specially by the compiler.
     """
     """
@@ -853,7 +853,7 @@ class MarkSafeIfAutoescape(Expr):
 class ContextReference(Expr):
 class ContextReference(Expr):
     """Returns the current template context.  It can be used like a
     """Returns the current template context.  It can be used like a
     :class:`Name` node, with a ``'load'`` ctx and will return the
     :class:`Name` node, with a ``'load'`` ctx and will return the
-    current :class:`~jinja2.runtime.Context` object.
+    current :class:`~ambari_jinja2.runtime.Context` object.
 
 
     Here an example that assigns the current template name to a
     Here an example that assigns the current template name to a
     variable named `foo`::
     variable named `foo`::
@@ -890,7 +890,7 @@ class EvalContextModifier(Stmt):
 class ScopedEvalContextModifier(EvalContextModifier):
 class ScopedEvalContextModifier(EvalContextModifier):
     """Modifies the eval context and reverts it later.  Works exactly like
     """Modifies the eval context and reverts it later.  Works exactly like
     :class:`EvalContextModifier` but will only modify the
     :class:`EvalContextModifier` but will only modify the
-    :class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
+    :class:`~ambari_jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
     """
     """
     fields = ('body',)
     fields = ('body',)
 
 

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/optimizer.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/optimizer.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.optimizer
+    ambari_jinja2.optimizer
     ~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~
 
 
     The jinja optimizer is currently trying to constant fold a few expressions
     The jinja optimizer is currently trying to constant fold a few expressions
@@ -16,8 +16,8 @@
     :copyright: (c) 2010 by the Jinja Team.
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD.
     :license: BSD.
 """
 """
-from jinja2 import nodes
-from jinja2.visitor import NodeTransformer
+from ambari_jinja2 import nodes
+from ambari_jinja2.visitor import NodeTransformer
 
 
 
 
 def optimize(node, environment):
 def optimize(node, environment):

+ 7 - 7
ambari-common/src/main/python/jinja2/jinja2/parser.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/parser.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.parser
+    ambari_jinja2.parser
     ~~~~~~~~~~~~~
     ~~~~~~~~~~~~~
 
 
     Implements the template parser.
     Implements the template parser.
@@ -8,10 +8,10 @@
     :copyright: (c) 2010 by the Jinja Team.
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
 """
 """
-from jinja2 import nodes
-from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
-from jinja2.utils import next
-from jinja2.lexer import describe_token, describe_token_expr
+from ambari_jinja2 import nodes
+from ambari_jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
+from ambari_jinja2.utils import next
+from ambari_jinja2.lexer import describe_token, describe_token_expr
 
 
 
 
 #: statements that callinto 
 #: statements that callinto 
@@ -104,7 +104,7 @@ class Parser(object):
         return False
         return False
 
 
     def free_identifier(self, lineno=None):
     def free_identifier(self, lineno=None):
-        """Return a new free identifier as :class:`~jinja2.nodes.InternalName`."""
+        """Return a new free identifier as :class:`~ambari_jinja2.nodes.InternalName`."""
         self._last_identifier += 1
         self._last_identifier += 1
         rv = object.__new__(nodes.InternalName)
         rv = object.__new__(nodes.InternalName)
         nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)
         nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)
@@ -578,7 +578,7 @@ class Parser(object):
     def parse_tuple(self, simplified=False, with_condexpr=True,
     def parse_tuple(self, simplified=False, with_condexpr=True,
                     extra_end_rules=None, explicit_parentheses=False):
                     extra_end_rules=None, explicit_parentheses=False):
         """Works like `parse_expression` but if multiple expressions are
         """Works like `parse_expression` but if multiple expressions are
-        delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.
+        delimited by a comma a :class:`~ambari_jinja2.nodes.Tuple` node is created.
         This method could also return a regular expression instead of a tuple
         This method could also return a regular expression instead of a tuple
         if no commas where found.
         if no commas where found.
 
 

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/runtime.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/runtime.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.runtime
+    ambari_jinja2.runtime
     ~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~
 
 
     Runtime helpers.
     Runtime helpers.
@@ -10,10 +10,10 @@
 """
 """
 import sys
 import sys
 from itertools import chain, imap
 from itertools import chain, imap
-from jinja2.nodes import EvalContext, _context_function_types
-from jinja2.utils import Markup, partial, soft_unicode, escape, missing, \
+from ambari_jinja2.nodes import EvalContext, _context_function_types
+from ambari_jinja2.utils import Markup, partial, soft_unicode, escape, missing, \
      concat, internalcode, next, object_type_repr
      concat, internalcode, next, object_type_repr
-from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
+from ambari_jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
      TemplateNotFound
      TemplateNotFound
 
 
 
 

+ 7 - 7
ambari-common/src/main/python/jinja2/jinja2/sandbox.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/sandbox.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.sandbox
+    ambari_jinja2.sandbox
     ~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~
 
 
     Adds a sandbox layer to Jinja as it was the default behavior in the old
     Adds a sandbox layer to Jinja as it was the default behavior in the old
@@ -13,10 +13,10 @@
     :license: BSD.
     :license: BSD.
 """
 """
 import operator
 import operator
-from jinja2.runtime import Undefined
-from jinja2.environment import Environment
-from jinja2.exceptions import SecurityError
-from jinja2.utils import FunctionType, MethodType, TracebackType, CodeType, \
+from ambari_jinja2.runtime import Undefined
+from ambari_jinja2.environment import Environment
+from ambari_jinja2.exceptions import SecurityError
+from ambari_jinja2.utils import FunctionType, MethodType, TracebackType, CodeType, \
      FrameType, GeneratorType
      FrameType, GeneratorType
 
 
 
 
@@ -35,7 +35,7 @@ import warnings
 
 
 # make sure we don't warn in python 2.6 about stuff we don't care about
 # make sure we don't warn in python 2.6 about stuff we don't care about
 warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,
 warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,
-                        module='jinja2.sandbox')
+                        module='ambari_jinja2.sandbox')
 
 
 from collections import deque
 from collections import deque
 
 
@@ -116,7 +116,7 @@ def is_internal_attribute(obj, attr):
     python objects.  This is useful if the environment method
     python objects.  This is useful if the environment method
     :meth:`~SandboxedEnvironment.is_safe_attribute` is overriden.
     :meth:`~SandboxedEnvironment.is_safe_attribute` is overriden.
 
 
-    >>> from jinja2.sandbox import is_internal_attribute
+    >>> from ambari_jinja2.sandbox import is_internal_attribute
     >>> is_internal_attribute(lambda: None, "func_code")
     >>> is_internal_attribute(lambda: None, "func_code")
     True
     True
     >>> is_internal_attribute((lambda x:x).func_code, 'co_code')
     >>> is_internal_attribute((lambda x:x).func_code, 'co_code')

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/tests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/tests.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.tests
+    ambari_jinja2.tests
     ~~~~~~~~~~~~
     ~~~~~~~~~~~~
 
 
     Jinja test functions. Used with the "is" operator.
     Jinja test functions. Used with the "is" operator.
@@ -9,7 +9,7 @@
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
 """
 """
 import re
 import re
-from jinja2.runtime import Undefined
+from ambari_jinja2.runtime import Undefined
 
 
 # nose, nothing here to test
 # nose, nothing here to test
 __test__ = False
 __test__ = False

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/__init__.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/__init__.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite
+    ambari_jinja2.testsuite
     ~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~
 
 
     All the unittests of Jinja2.  These tests can be executed by
     All the unittests of Jinja2.  These tests can be executed by
@@ -15,7 +15,7 @@ import re
 import sys
 import sys
 import unittest
 import unittest
 from traceback import format_exception
 from traceback import format_exception
-from jinja2 import loaders
+from ambari_jinja2 import loaders
 
 
 
 
 here = os.path.dirname(os.path.abspath(__file__))
 here = os.path.dirname(os.path.abspath(__file__))
@@ -23,7 +23,7 @@ here = os.path.dirname(os.path.abspath(__file__))
 dict_loader = loaders.DictLoader({
 dict_loader = loaders.DictLoader({
     'justdict.html':        'FOO'
     'justdict.html':        'FOO'
 })
 })
-package_loader = loaders.PackageLoader('jinja2.testsuite.res', 'templates')
+package_loader = loaders.PackageLoader('ambari_jinja2.testsuite.res', 'templates')
 filesystem_loader = loaders.FileSystemLoader(here + '/res/templates')
 filesystem_loader = loaders.FileSystemLoader(here + '/res/templates')
 function_loader = loaders.FunctionLoader({'justfunction.html': 'FOO'}.get)
 function_loader = loaders.FunctionLoader({'justfunction.html': 'FOO'}.get)
 choice_loader = loaders.ChoiceLoader([dict_loader, package_loader])
 choice_loader = loaders.ChoiceLoader([dict_loader, package_loader])
@@ -69,7 +69,7 @@ class JinjaTestCase(unittest.TestCase):
 
 
 
 
 def suite():
 def suite():
-    from jinja2.testsuite import ext, filters, tests, core_tags, \
+    from ambari_jinja2.testsuite import ext, filters, tests, core_tags, \
          loader, inheritance, imports, lexnparse, security, api, \
          loader, inheritance, imports, lexnparse, security, api, \
          regression, debug, utils, doctests
          regression, debug, utils, doctests
     suite = unittest.TestSuite()
     suite = unittest.TestSuite()

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/api.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/api.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.api
+    ambari_jinja2.testsuite.api
     ~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~
 
 
     Tests the public API and related stuff.
     Tests the public API and related stuff.
@@ -13,12 +13,12 @@ import time
 import tempfile
 import tempfile
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Environment, Undefined, DebugUndefined, \
+from ambari_jinja2 import Environment, Undefined, DebugUndefined, \
      StrictUndefined, UndefinedError, Template, meta, \
      StrictUndefined, UndefinedError, Template, meta, \
      is_undefined, Template, DictLoader
      is_undefined, Template, DictLoader
-from jinja2.utils import Cycler
+from ambari_jinja2.utils import Cycler
 
 
 env = Environment()
 env = Environment()
 
 
@@ -26,7 +26,7 @@ env = Environment()
 class ExtendedAPITestCase(JinjaTestCase):
 class ExtendedAPITestCase(JinjaTestCase):
 
 
     def test_item_and_attribute(self):
     def test_item_and_attribute(self):
-        from jinja2.sandbox import SandboxedEnvironment
+        from ambari_jinja2.sandbox import SandboxedEnvironment
 
 
         for env in Environment(), SandboxedEnvironment():
         for env in Environment(), SandboxedEnvironment():
             # the |list is necessary for python3
             # the |list is necessary for python3

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/core_tags.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/core_tags.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.core_tags
+    ambari_jinja2.testsuite.core_tags
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     Test the core tags like for and if.
     Test the core tags like for and if.
@@ -11,9 +11,9 @@
 import re
 import re
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Environment, TemplateSyntaxError, UndefinedError, \
+from ambari_jinja2 import Environment, TemplateSyntaxError, UndefinedError, \
      DictLoader
      DictLoader
 
 
 env = Environment()
 env = Environment()

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/debug.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/debug.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.debug
+    ambari_jinja2.testsuite.debug
     ~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~
 
 
     Tests the debug system.
     Tests the debug system.
@@ -11,9 +11,9 @@
 import sys
 import sys
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase, filesystem_loader
+from ambari_jinja2.testsuite import JinjaTestCase, filesystem_loader
 
 
-from jinja2 import Environment, TemplateSyntaxError
+from ambari_jinja2 import Environment, TemplateSyntaxError
 
 
 env = Environment(loader=filesystem_loader)
 env = Environment(loader=filesystem_loader)
 
 
@@ -41,7 +41,7 @@ ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero
         self.assert_traceback_matches(lambda: env.get_template('syntaxerror.html'), r'''(?sm)
         self.assert_traceback_matches(lambda: env.get_template('syntaxerror.html'), r'''(?sm)
   File ".*?syntaxerror.html", line 4, in (template|<module>)
   File ".*?syntaxerror.html", line 4, in (template|<module>)
     \{% endif %\}.*?
     \{% endif %\}.*?
-(jinja2\.exceptions\.)?TemplateSyntaxError: Encountered unknown tag 'endif'. Jinja was looking for the following tags: 'endfor' or 'else'. The innermost block that needs to be closed is 'for'.
+(ambari_jinja2\.exceptions\.)?TemplateSyntaxError: Encountered unknown tag 'endif'. Jinja was looking for the following tags: 'endfor' or 'else'. The innermost block that needs to be closed is 'for'.
     ''')
     ''')
 
 
     def test_regular_syntax_error(self):
     def test_regular_syntax_error(self):
@@ -50,7 +50,7 @@ ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero
         self.assert_traceback_matches(test, r'''
         self.assert_traceback_matches(test, r'''
   File ".*debug.pyc?", line \d+, in test
   File ".*debug.pyc?", line \d+, in test
     raise TemplateSyntaxError\('wtf', 42\)
     raise TemplateSyntaxError\('wtf', 42\)
-(jinja2\.exceptions\.)?TemplateSyntaxError: wtf
+(ambari_jinja2\.exceptions\.)?TemplateSyntaxError: wtf
   line 42''')
   line 42''')
 
 
 
 

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/testsuite/doctests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/doctests.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.doctests
+    ambari_jinja2.testsuite.doctests
     ~~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     The doctests.  Collects all tests we want to test from
     The doctests.  Collects all tests we want to test from
@@ -14,7 +14,7 @@ import doctest
 
 
 
 
 def suite():
 def suite():
-    from jinja2 import utils, sandbox, runtime, meta, loaders, \
+    from ambari_jinja2 import utils, sandbox, runtime, meta, loaders, \
         ext, environment, bccache, nodes
         ext, environment, bccache, nodes
     suite = unittest.TestSuite()
     suite = unittest.TestSuite()
     suite.addTest(doctest.DocTestSuite(utils))
     suite.addTest(doctest.DocTestSuite(utils))

+ 25 - 25
ambari-common/src/main/python/jinja2/jinja2/testsuite/ext.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/ext.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.ext
+    ambari_jinja2.testsuite.ext
     ~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~
 
 
     Tests for the extensions.
     Tests for the extensions.
@@ -11,13 +11,13 @@
 import re
 import re
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase, filesystem_loader
+from ambari_jinja2.testsuite import JinjaTestCase, filesystem_loader
 
 
-from jinja2 import Environment, DictLoader, contextfunction, nodes
-from jinja2.exceptions import TemplateAssertionError
-from jinja2.ext import Extension
-from jinja2.lexer import Token, count_newlines
-from jinja2.utils import next
+from ambari_jinja2 import Environment, DictLoader, contextfunction, nodes
+from ambari_jinja2.exceptions import TemplateAssertionError
+from ambari_jinja2.ext import Extension
+from ambari_jinja2.lexer import Token, count_newlines
+from ambari_jinja2.utils import next
 
 
 # 2.x / 3.x
 # 2.x / 3.x
 try:
 try:
@@ -91,7 +91,7 @@ def ngettext(context, s, p, n):
 
 
 i18n_env = Environment(
 i18n_env = Environment(
     loader=DictLoader(i18n_templates),
     loader=DictLoader(i18n_templates),
-    extensions=['jinja2.ext.i18n']
+    extensions=['ambari_jinja2.ext.i18n']
 )
 )
 i18n_env.globals.update({
 i18n_env.globals.update({
     '_':            gettext,
     '_':            gettext,
@@ -101,7 +101,7 @@ i18n_env.globals.update({
 
 
 newstyle_i18n_env = Environment(
 newstyle_i18n_env = Environment(
     loader=DictLoader(newstyle_i18n_templates),
     loader=DictLoader(newstyle_i18n_templates),
-    extensions=['jinja2.ext.i18n']
+    extensions=['ambari_jinja2.ext.i18n']
 )
 )
 newstyle_i18n_env.install_gettext_callables(gettext, ngettext, newstyle=True)
 newstyle_i18n_env.install_gettext_callables(gettext, ngettext, newstyle=True)
 
 
@@ -169,12 +169,12 @@ class ExtensionsTestCase(JinjaTestCase):
 
 
     def test_extend_late(self):
     def test_extend_late(self):
         env = Environment()
         env = Environment()
-        env.add_extension('jinja2.ext.autoescape')
+        env.add_extension('ambari_jinja2.ext.autoescape')
         t = env.from_string('{% autoescape true %}{{ "<test>" }}{% endautoescape %}')
         t = env.from_string('{% autoescape true %}{{ "<test>" }}{% endautoescape %}')
         assert t.render() == '&lt;test&gt;'
         assert t.render() == '&lt;test&gt;'
 
 
     def test_loop_controls(self):
     def test_loop_controls(self):
-        env = Environment(extensions=['jinja2.ext.loopcontrols'])
+        env = Environment(extensions=['ambari_jinja2.ext.loopcontrols'])
 
 
         tmpl = env.from_string('''
         tmpl = env.from_string('''
             {%- for item in [1, 2, 3, 4] %}
             {%- for item in [1, 2, 3, 4] %}
@@ -191,7 +191,7 @@ class ExtensionsTestCase(JinjaTestCase):
         assert tmpl.render() == '12'
         assert tmpl.render() == '12'
 
 
     def test_do(self):
     def test_do(self):
-        env = Environment(extensions=['jinja2.ext.do'])
+        env = Environment(extensions=['ambari_jinja2.ext.do'])
         tmpl = env.from_string('''
         tmpl = env.from_string('''
             {%- set items = [] %}
             {%- set items = [] %}
             {%- for char in "foo" %}
             {%- for char in "foo" %}
@@ -200,7 +200,7 @@ class ExtensionsTestCase(JinjaTestCase):
         assert tmpl.render() == '0f, 1o, 2o'
         assert tmpl.render() == '0f, 1o, 2o'
 
 
     def test_with(self):
     def test_with(self):
-        env = Environment(extensions=['jinja2.ext.with_'])
+        env = Environment(extensions=['ambari_jinja2.ext.with_'])
         tmpl = env.from_string('''\
         tmpl = env.from_string('''\
         {% with a=42, b=23 -%}
         {% with a=42, b=23 -%}
             {{ a }} = {{ b }}
             {{ a }} = {{ b }}
@@ -271,7 +271,7 @@ class InternationalizationTestCase(JinjaTestCase):
         assert tmpl.render(LANGUAGE='de', user_count=5) == 'Benutzer: 5'
         assert tmpl.render(LANGUAGE='de', user_count=5) == 'Benutzer: 5'
 
 
     def test_extract(self):
     def test_extract(self):
-        from jinja2.ext import babel_extract
+        from ambari_jinja2.ext import babel_extract
         source = BytesIO('''
         source = BytesIO('''
         {{ gettext('Hello World') }}
         {{ gettext('Hello World') }}
         {% trans %}Hello World{% endtrans %}
         {% trans %}Hello World{% endtrans %}
@@ -284,7 +284,7 @@ class InternationalizationTestCase(JinjaTestCase):
         ]
         ]
 
 
     def test_comment_extract(self):
     def test_comment_extract(self):
-        from jinja2.ext import babel_extract
+        from ambari_jinja2.ext import babel_extract
         source = BytesIO('''
         source = BytesIO('''
         {# trans first #}
         {# trans first #}
         {{ gettext('Hello World') }}
         {{ gettext('Hello World') }}
@@ -327,8 +327,8 @@ class NewstyleInternationalizationTestCase(JinjaTestCase):
         assert tmpl.render(LANGUAGE='de', apples=5) == u'5 Äpfel'
         assert tmpl.render(LANGUAGE='de', apples=5) == u'5 Äpfel'
 
 
     def test_autoescape_support(self):
     def test_autoescape_support(self):
-        env = Environment(extensions=['jinja2.ext.autoescape',
-                                      'jinja2.ext.i18n'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape',
+                                      'ambari_jinja2.ext.i18n'])
         env.install_gettext_callables(lambda x: u'<strong>Wert: %(name)s</strong>',
         env.install_gettext_callables(lambda x: u'<strong>Wert: %(name)s</strong>',
                                       lambda s, p, n: s, newstyle=True)
                                       lambda s, p, n: s, newstyle=True)
         t = env.from_string('{% autoescape ae %}{{ gettext("foo", name='
         t = env.from_string('{% autoescape ae %}{{ gettext("foo", name='
@@ -372,7 +372,7 @@ class NewstyleInternationalizationTestCase(JinjaTestCase):
 class AutoEscapeTestCase(JinjaTestCase):
 class AutoEscapeTestCase(JinjaTestCase):
 
 
     def test_scoped_setting(self):
     def test_scoped_setting(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
                           autoescape=True)
         tmpl = env.from_string('''
         tmpl = env.from_string('''
             {{ "<HelloWorld>" }}
             {{ "<HelloWorld>" }}
@@ -384,7 +384,7 @@ class AutoEscapeTestCase(JinjaTestCase):
         assert tmpl.render().split() == \
         assert tmpl.render().split() == \
             [u'&lt;HelloWorld&gt;', u'<HelloWorld>', u'&lt;HelloWorld&gt;']
             [u'&lt;HelloWorld&gt;', u'<HelloWorld>', u'&lt;HelloWorld&gt;']
 
 
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=False)
                           autoescape=False)
         tmpl = env.from_string('''
         tmpl = env.from_string('''
             {{ "<HelloWorld>" }}
             {{ "<HelloWorld>" }}
@@ -397,7 +397,7 @@ class AutoEscapeTestCase(JinjaTestCase):
             [u'<HelloWorld>', u'&lt;HelloWorld&gt;', u'<HelloWorld>']
             [u'<HelloWorld>', u'&lt;HelloWorld&gt;', u'<HelloWorld>']
 
 
     def test_nonvolatile(self):
     def test_nonvolatile(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
                           autoescape=True)
         tmpl = env.from_string('{{ {"foo": "<test>"}|xmlattr|escape }}')
         tmpl = env.from_string('{{ {"foo": "<test>"}|xmlattr|escape }}')
         assert tmpl.render() == ' foo="&lt;test&gt;"'
         assert tmpl.render() == ' foo="&lt;test&gt;"'
@@ -406,7 +406,7 @@ class AutoEscapeTestCase(JinjaTestCase):
         assert tmpl.render() == ' foo=&#34;&amp;lt;test&amp;gt;&#34;'
         assert tmpl.render() == ' foo=&#34;&amp;lt;test&amp;gt;&#34;'
 
 
     def test_volatile(self):
     def test_volatile(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
                           autoescape=True)
         tmpl = env.from_string('{% autoescape foo %}{{ {"foo": "<test>"}'
         tmpl = env.from_string('{% autoescape foo %}{{ {"foo": "<test>"}'
                                '|xmlattr|escape }}{% endautoescape %}')
                                '|xmlattr|escape }}{% endautoescape %}')
@@ -414,13 +414,13 @@ class AutoEscapeTestCase(JinjaTestCase):
         assert tmpl.render(foo=True) == ' foo="&lt;test&gt;"'
         assert tmpl.render(foo=True) == ' foo="&lt;test&gt;"'
 
 
     def test_scoping(self):
     def test_scoping(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'])
         tmpl = env.from_string('{% autoescape true %}{% set x = "<x>" %}{{ x }}'
         tmpl = env.from_string('{% autoescape true %}{% set x = "<x>" %}{{ x }}'
                                '{% endautoescape %}{{ x }}{{ "<y>" }}')
                                '{% endautoescape %}{{ x }}{{ "<y>" }}')
         assert tmpl.render(x=1) == '&lt;x&gt;1<y>'
         assert tmpl.render(x=1) == '&lt;x&gt;1<y>'
 
 
     def test_volatile_scoping(self):
     def test_volatile_scoping(self):
-        env = Environment(extensions=['jinja2.ext.autoescape'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'])
         tmplsource = '''
         tmplsource = '''
         {% autoescape val %}
         {% autoescape val %}
             {% macro foo(x) %}
             {% macro foo(x) %}
@@ -436,11 +436,11 @@ class AutoEscapeTestCase(JinjaTestCase):
 
 
         # looking at the source we should see <testing> there in raw
         # looking at the source we should see <testing> there in raw
         # (and then escaped as well)
         # (and then escaped as well)
-        env = Environment(extensions=['jinja2.ext.autoescape'])
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'])
         pysource = env.compile(tmplsource, raw=True)
         pysource = env.compile(tmplsource, raw=True)
         assert '<testing>\\n' in pysource
         assert '<testing>\\n' in pysource
 
 
-        env = Environment(extensions=['jinja2.ext.autoescape'],
+        env = Environment(extensions=['ambari_jinja2.ext.autoescape'],
                           autoescape=True)
                           autoescape=True)
         pysource = env.compile(tmplsource, raw=True)
         pysource = env.compile(tmplsource, raw=True)
         assert '&lt;testing&gt;\\n' in pysource
         assert '&lt;testing&gt;\\n' in pysource

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/filters.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/filters.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.filters
+    ambari_jinja2.testsuite.filters
     ~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     Tests for the jinja filters.
     Tests for the jinja filters.
@@ -9,9 +9,9 @@
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
 """
 """
 import unittest
 import unittest
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Markup, Environment
+from ambari_jinja2 import Markup, Environment
 
 
 env = Environment()
 env = Environment()
 
 

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/imports.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/imports.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.imports
+    ambari_jinja2.testsuite.imports
     ~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     Tests the import features (with includes).
     Tests the import features (with includes).
@@ -13,10 +13,10 @@ import time
 import tempfile
 import tempfile
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Environment, DictLoader
-from jinja2.exceptions import TemplateNotFound, TemplatesNotFound
+from ambari_jinja2 import Environment, DictLoader
+from ambari_jinja2.exceptions import TemplateNotFound, TemplatesNotFound
 
 
 
 
 test_env = Environment(loader=DictLoader(dict(
 test_env = Environment(loader=DictLoader(dict(

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/inheritance.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/inheritance.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.inheritance
+    ambari_jinja2.testsuite.inheritance
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     Tests the template inheritance feature.
     Tests the template inheritance feature.
@@ -13,10 +13,10 @@ import time
 import tempfile
 import tempfile
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Environment, DictLoader
-from jinja2.exceptions import TemplateSyntaxError
+from ambari_jinja2 import Environment, DictLoader
+from ambari_jinja2.exceptions import TemplateSyntaxError
 
 
 
 
 LAYOUTTEMPLATE = '''\
 LAYOUTTEMPLATE = '''\

+ 4 - 4
ambari-common/src/main/python/jinja2/jinja2/testsuite/lexnparse.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/lexnparse.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.lexnparse
+    ambari_jinja2.testsuite.lexnparse
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     All the unittests regarding lexing, parsing and syntax.
     All the unittests regarding lexing, parsing and syntax.
@@ -14,9 +14,9 @@ import time
 import tempfile
 import tempfile
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Environment, Template, TemplateSyntaxError, \
+from ambari_jinja2 import Environment, Template, TemplateSyntaxError, \
      UndefinedError, nodes
      UndefinedError, nodes
 
 
 env = Environment()
 env = Environment()
@@ -70,7 +70,7 @@ class LexerTestCase(JinjaTestCase):
         assert tmpl.render() == pformat('foo') + '|' + pformat(u'bär')
         assert tmpl.render() == pformat('foo') + '|' + pformat(u'bär')
 
 
     def test_operators(self):
     def test_operators(self):
-        from jinja2.lexer import operators
+        from ambari_jinja2.lexer import operators
         for test, expect in operators.iteritems():
         for test, expect in operators.iteritems():
             if test in '([{}])':
             if test in '([{}])':
                 continue
                 continue

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/loader.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/loader.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.loader
+    ambari_jinja2.testsuite.loader
     ~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~
 
 
     Test the loaders.
     Test the loaders.
@@ -15,13 +15,13 @@ import tempfile
 import shutil
 import shutil
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase, dict_loader, \
+from ambari_jinja2.testsuite import JinjaTestCase, dict_loader, \
      package_loader, filesystem_loader, function_loader, \
      package_loader, filesystem_loader, function_loader, \
      choice_loader, prefix_loader
      choice_loader, prefix_loader
 
 
-from jinja2 import Environment, loaders
-from jinja2.loaders import split_template_path
-from jinja2.exceptions import TemplateNotFound
+from ambari_jinja2 import Environment, loaders
+from ambari_jinja2.loaders import split_template_path
+from ambari_jinja2.exceptions import TemplateNotFound
 
 
 
 
 class LoaderTestCase(JinjaTestCase):
 class LoaderTestCase(JinjaTestCase):

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/regression.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/regression.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.regression
+    ambari_jinja2.testsuite.regression
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     Tests corner cases and bugs.
     Tests corner cases and bugs.
@@ -13,9 +13,9 @@ import time
 import tempfile
 import tempfile
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Template, Environment, DictLoader, TemplateSyntaxError, \
+from ambari_jinja2 import Template, Environment, DictLoader, TemplateSyntaxError, \
      TemplateNotFound, PrefixLoader
      TemplateNotFound, PrefixLoader
 
 
 env = Environment()
 env = Environment()

+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/broken.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/broken.html


+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/foo/test.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/foo/test.html


+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/syntaxerror.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/syntaxerror.html


+ 0 - 0
ambari-common/src/main/python/jinja2/jinja2/testsuite/res/templates/test.html → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/res/templates/test.html


+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/testsuite/security.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/security.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.security
+    ambari_jinja2.testsuite.security
     ~~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
     Checks the sandbox and other security features.
     Checks the sandbox and other security features.
@@ -13,13 +13,13 @@ import time
 import tempfile
 import tempfile
 import unittest
 import unittest
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Environment
-from jinja2.sandbox import SandboxedEnvironment, \
+from ambari_jinja2 import Environment
+from ambari_jinja2.sandbox import SandboxedEnvironment, \
      ImmutableSandboxedEnvironment, unsafe
      ImmutableSandboxedEnvironment, unsafe
-from jinja2 import Markup, escape
-from jinja2.exceptions import SecurityError, TemplateSyntaxError
+from ambari_jinja2 import Markup, escape
+from ambari_jinja2.exceptions import SecurityError, TemplateSyntaxError
 
 
 
 
 class PrivateStuff(object):
 class PrivateStuff(object):

+ 3 - 3
ambari-common/src/main/python/jinja2/jinja2/testsuite/tests.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/tests.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.tests
+    ambari_jinja2.testsuite.tests
     ~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~
 
 
     Who tests the tests?
     Who tests the tests?
@@ -9,9 +9,9 @@
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
 """
 """
 import unittest
 import unittest
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Markup, Environment
+from ambari_jinja2 import Markup, Environment
 
 
 env = Environment()
 env = Environment()
 
 

+ 5 - 5
ambari-common/src/main/python/jinja2/jinja2/testsuite/utils.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/utils.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.testsuite.utils
+    ambari_jinja2.testsuite.utils
     ~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~
 
 
     Tests utilities jinja uses.
     Tests utilities jinja uses.
@@ -14,11 +14,11 @@ import unittest
 
 
 import pickle
 import pickle
 
 
-from jinja2.testsuite import JinjaTestCase
+from ambari_jinja2.testsuite import JinjaTestCase
 
 
-from jinja2 import Environment, Undefined, DebugUndefined, \
+from ambari_jinja2 import Environment, Undefined, DebugUndefined, \
      StrictUndefined, UndefinedError, Template, meta
      StrictUndefined, UndefinedError, Template, meta
-from jinja2.utils import LRUCache, escape, object_type_repr
+from ambari_jinja2.utils import LRUCache, escape, object_type_repr
 
 
 
 
 class LRUCacheTestCase(JinjaTestCase):
 class LRUCacheTestCase(JinjaTestCase):
@@ -54,7 +54,7 @@ class HelpersTestCase(JinjaTestCase):
         self.assert_equal(object_type_repr(42), 'int object')
         self.assert_equal(object_type_repr(42), 'int object')
         self.assert_equal(object_type_repr([]), 'list object')
         self.assert_equal(object_type_repr([]), 'list object')
         self.assert_equal(object_type_repr(X()),
         self.assert_equal(object_type_repr(X()),
-                         'jinja2.testsuite.utils.X object')
+                         'ambari_jinja2.testsuite.utils.X object')
         self.assert_equal(object_type_repr(None), 'None')
         self.assert_equal(object_type_repr(None), 'None')
         self.assert_equal(object_type_repr(Ellipsis), 'Ellipsis')
         self.assert_equal(object_type_repr(Ellipsis), 'Ellipsis')
 
 

+ 6 - 6
ambari-common/src/main/python/jinja2/jinja2/utils.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/utils.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.utils
+    ambari_jinja2.utils
     ~~~~~~~~~~~~
     ~~~~~~~~~~~~
 
 
     Utility functions.
     Utility functions.
@@ -168,7 +168,7 @@ def is_undefined(obj):
                 return default
                 return default
             return var
             return var
     """
     """
-    from jinja2.runtime import Undefined
+    from ambari_jinja2.runtime import Undefined
     return isinstance(obj, Undefined)
     return isinstance(obj, Undefined)
 
 
 
 
@@ -184,8 +184,8 @@ def clear_caches():
     the time.  Normally you don't have to care about that but if you are
     the time.  Normally you don't have to care about that but if you are
     messuring memory consumption you may want to clean the caches.
     messuring memory consumption you may want to clean the caches.
     """
     """
-    from jinja2.environment import _spontaneous_environments
-    from jinja2.lexer import _lexer_cache
+    from ambari_jinja2.environment import _spontaneous_environments
+    from ambari_jinja2.lexer import _lexer_cache
     _spontaneous_environments.clear()
     _spontaneous_environments.clear()
     _lexer_cache.clear()
     _lexer_cache.clear()
 
 
@@ -302,7 +302,7 @@ def urlize(text, trim_url_limit=None, nofollow=False):
 
 
 def generate_lorem_ipsum(n=5, html=True, min=20, max=100):
 def generate_lorem_ipsum(n=5, html=True, min=20, max=100):
     """Generate some lorem impsum for the template."""
     """Generate some lorem impsum for the template."""
-    from jinja2.constants import LOREM_IPSUM_WORDS
+    from ambari_jinja2.constants import LOREM_IPSUM_WORDS
     from random import choice, randrange
     from random import choice, randrange
     words = LOREM_IPSUM_WORDS.split()
     words = LOREM_IPSUM_WORDS.split()
     result = []
     result = []
@@ -584,7 +584,7 @@ class Joiner(object):
 try:
 try:
     from markupsafe import Markup, escape, soft_unicode
     from markupsafe import Markup, escape, soft_unicode
 except ImportError:
 except ImportError:
-    from jinja2._markupsafe import Markup, escape, soft_unicode
+    from ambari_jinja2._markupsafe import Markup, escape, soft_unicode
 
 
 
 
 # partials
 # partials

+ 2 - 2
ambari-common/src/main/python/jinja2/jinja2/visitor.py → ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/visitor.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 """
 """
-    jinja2.visitor
+    ambari_jinja2.visitor
     ~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~
 
 
     This module implements a visitor for the nodes.
     This module implements a visitor for the nodes.
@@ -8,7 +8,7 @@
     :copyright: (c) 2010 by the Jinja Team.
     :copyright: (c) 2010 by the Jinja Team.
     :license: BSD.
     :license: BSD.
 """
 """
-from jinja2.nodes import Node
+from ambari_jinja2.nodes import Node
 
 
 
 
 class NodeVisitor(object):
 class NodeVisitor(object):

+ 2 - 2
ambari-common/src/main/python/jinja2/artwork/jinjalogo.svg → ambari-common/src/main/python/ambari_jinja2/artwork/jinjalogo.svg

@@ -15,9 +15,9 @@
    sodipodi:version="0.32"
    sodipodi:version="0.32"
    inkscape:version="0.45.1"
    inkscape:version="0.45.1"
    version="1.0"
    version="1.0"
-   sodipodi:docbase="/Users/mitsuhiko/Development/jinja2/artwork"
+   sodipodi:docbase="/Users/mitsuhiko/Development/ambari_jinja2/artwork"
    sodipodi:docname="jinjalogo.svg"
    sodipodi:docname="jinjalogo.svg"
-   inkscape:export-filename="/Users/mitsuhiko/Development/jinja2/docs/_static/jinjabanner.png"
+   inkscape:export-filename="/Users/mitsuhiko/Development/ambari_jinja2/docs/_static/jinjabanner.png"
    inkscape:export-xdpi="60"
    inkscape:export-xdpi="60"
    inkscape:export-ydpi="60"
    inkscape:export-ydpi="60"
    inkscape:output_extension="org.inkscape.output.svg.inkscape">
    inkscape:output_extension="org.inkscape.output.svg.inkscape">

+ 0 - 0
ambari-common/src/main/python/jinja2/custom_fixers/fix_alt_unicode.py → ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_alt_unicode.py


+ 0 - 0
ambari-common/src/main/python/jinja2/custom_fixers/fix_broken_reraising.py → ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_broken_reraising.py


+ 0 - 0
ambari-common/src/main/python/jinja2/custom_fixers/fix_xrange2.py → ambari-common/src/main/python/ambari_jinja2/custom_fixers/fix_xrange2.py


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/Makefile → ambari-common/src/main/python/ambari_jinja2/docs/Makefile


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_static/jinja.js → ambari-common/src/main/python/ambari_jinja2/docs/_static/jinja.js


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_static/print.css → ambari-common/src/main/python/ambari_jinja2/docs/_static/print.css


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_static/style.css → ambari-common/src/main/python/ambari_jinja2/docs/_static/style.css


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/genindex.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/genindex.html


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/layout.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/layout.html


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/opensearch.xml → ambari-common/src/main/python/ambari_jinja2/docs/_templates/opensearch.xml


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/page.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/page.html


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/_templates/search.html → ambari-common/src/main/python/ambari_jinja2/docs/_templates/search.html


+ 40 - 40
ambari-common/src/main/python/jinja2/docs/api.rst → ambari-common/src/main/python/ambari_jinja2/docs/api.rst

@@ -1,7 +1,7 @@
 API
 API
 ===
 ===
 
 
-.. module:: jinja2
+.. module:: ambari_jinja2
     :synopsis: public Jinja2 API
     :synopsis: public Jinja2 API
 
 
 This document describes the API to Jinja2 and not the template language.  It
 This document describes the API to Jinja2 and not the template language.  It
@@ -26,7 +26,7 @@ are in use.
 The simplest way to configure Jinja2 to load templates for your application
 The simplest way to configure Jinja2 to load templates for your application
 looks roughly like this::
 looks roughly like this::
 
 
-    from jinja2 import Environment, PackageLoader
+    from ambari_jinja2 import Environment, PackageLoader
     env = Environment(loader=PackageLoader('yourapplication', 'templates'))
     env = Environment(loader=PackageLoader('yourapplication', 'templates'))
 
 
 This will create a template environment with the default settings and a
 This will create a template environment with the default settings and a
@@ -130,7 +130,7 @@ useful if you want to dig deeper into Jinja2 or :ref:`develop extensions
 
 
         If the environment is sandboxed this attribute is `True`.  For the
         If the environment is sandboxed this attribute is `True`.  For the
         sandbox mode have a look at the documentation for the
         sandbox mode have a look at the documentation for the
-        :class:`~jinja2.sandbox.SandboxedEnvironment`.
+        :class:`~ambari_jinja2.sandbox.SandboxedEnvironment`.
 
 
     .. attribute:: filters
     .. attribute:: filters
 
 
@@ -216,7 +216,7 @@ useful if you want to dig deeper into Jinja2 or :ref:`develop extensions
     .. automethod:: stream([context])
     .. automethod:: stream([context])
 
 
 
 
-.. autoclass:: jinja2.environment.TemplateStream()
+.. autoclass:: ambari_jinja2.environment.TemplateStream()
     :members: disable_buffering, enable_buffering, dump
     :members: disable_buffering, enable_buffering, dump
 
 
 
 
@@ -242,7 +242,7 @@ for all other extensions::
 
 
     env = Environment(autoescape=guess_autoescape,
     env = Environment(autoescape=guess_autoescape,
                       loader=PackageLoader('mypackage'),
                       loader=PackageLoader('mypackage'),
-                      extensions=['jinja2.ext.autoescape'])
+                      extensions=['ambari_jinja2.ext.autoescape'])
 
 
 When implementing a guessing autoescape function, make sure you also
 When implementing a guessing autoescape function, make sure you also
 accept `None` as valid template name.  This will be passed when generating
 accept `None` as valid template name.  This will be passed when generating
@@ -283,7 +283,7 @@ others fail.
 The closest to regular Python behavior is the `StrictUndefined` which
 The closest to regular Python behavior is the `StrictUndefined` which
 disallows all operations beside testing if it's an undefined object.
 disallows all operations beside testing if it's an undefined object.
 
 
-.. autoclass:: jinja2.Undefined()
+.. autoclass:: ambari_jinja2.Undefined()
 
 
     .. attribute:: _undefined_hint
     .. attribute:: _undefined_hint
 
 
@@ -311,9 +311,9 @@ disallows all operations beside testing if it's an undefined object.
         :attr:`_undefined_exception` with an error message generated
         :attr:`_undefined_exception` with an error message generated
         from the undefined hints stored on the undefined object.
         from the undefined hints stored on the undefined object.
 
 
-.. autoclass:: jinja2.DebugUndefined()
+.. autoclass:: ambari_jinja2.DebugUndefined()
 
 
-.. autoclass:: jinja2.StrictUndefined()
+.. autoclass:: ambari_jinja2.StrictUndefined()
 
 
 Undefined objects are created by calling :attr:`undefined`.
 Undefined objects are created by calling :attr:`undefined`.
 
 
@@ -345,7 +345,7 @@ Undefined objects are created by calling :attr:`undefined`.
 The Context
 The Context
 -----------
 -----------
 
 
-.. autoclass:: jinja2.runtime.Context()
+.. autoclass:: ambari_jinja2.runtime.Context()
     :members: resolve, get_exported, get_all
     :members: resolve, get_exported, get_all
 
 
     .. attribute:: parent
     .. attribute:: parent
@@ -389,7 +389,7 @@ The Context
 
 
         The current :ref:`eval-context`.
         The current :ref:`eval-context`.
 
 
-    .. automethod:: jinja2.runtime.Context.call(callable, \*args, \**kwargs)
+    .. automethod:: ambari_jinja2.runtime.Context.call(callable, \*args, \**kwargs)
 
 
 
 
 .. admonition:: Implementation
 .. admonition:: Implementation
@@ -416,22 +416,22 @@ size by default and templates are automatically reloaded.
 All loaders are subclasses of :class:`BaseLoader`.  If you want to create your
 All loaders are subclasses of :class:`BaseLoader`.  If you want to create your
 own loader, subclass :class:`BaseLoader` and override `get_source`.
 own loader, subclass :class:`BaseLoader` and override `get_source`.
 
 
-.. autoclass:: jinja2.BaseLoader
+.. autoclass:: ambari_jinja2.BaseLoader
     :members: get_source, load
     :members: get_source, load
 
 
 Here a list of the builtin loaders Jinja2 provides:
 Here a list of the builtin loaders Jinja2 provides:
 
 
-.. autoclass:: jinja2.FileSystemLoader
+.. autoclass:: ambari_jinja2.FileSystemLoader
 
 
-.. autoclass:: jinja2.PackageLoader
+.. autoclass:: ambari_jinja2.PackageLoader
 
 
-.. autoclass:: jinja2.DictLoader
+.. autoclass:: ambari_jinja2.DictLoader
 
 
-.. autoclass:: jinja2.FunctionLoader
+.. autoclass:: ambari_jinja2.FunctionLoader
 
 
-.. autoclass:: jinja2.PrefixLoader
+.. autoclass:: ambari_jinja2.PrefixLoader
 
 
-.. autoclass:: jinja2.ChoiceLoader
+.. autoclass:: ambari_jinja2.ChoiceLoader
 
 
 
 
 .. _bytecode-cache:
 .. _bytecode-cache:
@@ -449,10 +449,10 @@ the application.
 
 
 To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.
 To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.
 
 
-.. autoclass:: jinja2.BytecodeCache
+.. autoclass:: ambari_jinja2.BytecodeCache
     :members: load_bytecode, dump_bytecode, clear
     :members: load_bytecode, dump_bytecode, clear
 
 
-.. autoclass:: jinja2.bccache.Bucket
+.. autoclass:: ambari_jinja2.bccache.Bucket
     :members: write_bytecode, load_bytecode, bytecode_from_string,
     :members: write_bytecode, load_bytecode, bytecode_from_string,
               bytecode_to_string, reset
               bytecode_to_string, reset
 
 
@@ -471,9 +471,9 @@ To use a bytecode cache, instanciate it and pass it to the :class:`Environment`.
 
 
 Builtin bytecode caches:
 Builtin bytecode caches:
 
 
-.. autoclass:: jinja2.FileSystemBytecodeCache
+.. autoclass:: ambari_jinja2.FileSystemBytecodeCache
 
 
-.. autoclass:: jinja2.MemcachedBytecodeCache
+.. autoclass:: ambari_jinja2.MemcachedBytecodeCache
 
 
 
 
 Utilities
 Utilities
@@ -482,17 +482,17 @@ Utilities
 These helper functions and classes are useful if you add custom filters or
 These helper functions and classes are useful if you add custom filters or
 functions to a Jinja2 environment.
 functions to a Jinja2 environment.
 
 
-.. autofunction:: jinja2.environmentfilter
+.. autofunction:: ambari_jinja2.environmentfilter
 
 
-.. autofunction:: jinja2.contextfilter
+.. autofunction:: ambari_jinja2.contextfilter
 
 
-.. autofunction:: jinja2.evalcontextfilter
+.. autofunction:: ambari_jinja2.evalcontextfilter
 
 
-.. autofunction:: jinja2.environmentfunction
+.. autofunction:: ambari_jinja2.environmentfunction
 
 
-.. autofunction:: jinja2.contextfunction
+.. autofunction:: ambari_jinja2.contextfunction
 
 
-.. autofunction:: jinja2.evalcontextfunction
+.. autofunction:: ambari_jinja2.evalcontextfunction
 
 
 .. function:: escape(s)
 .. function:: escape(s)
 
 
@@ -503,11 +503,11 @@ functions to a Jinja2 environment.
 
 
     The return value is a :class:`Markup` string.
     The return value is a :class:`Markup` string.
 
 
-.. autofunction:: jinja2.clear_caches
+.. autofunction:: ambari_jinja2.clear_caches
 
 
-.. autofunction:: jinja2.is_undefined
+.. autofunction:: ambari_jinja2.is_undefined
 
 
-.. autoclass:: jinja2.Markup([string])
+.. autoclass:: ambari_jinja2.Markup([string])
     :members: escape, unescape, striptags
     :members: escape, unescape, striptags
 
 
 .. admonition:: Note
 .. admonition:: Note
@@ -520,15 +520,15 @@ functions to a Jinja2 environment.
 Exceptions
 Exceptions
 ----------
 ----------
 
 
-.. autoexception:: jinja2.TemplateError
+.. autoexception:: ambari_jinja2.TemplateError
 
 
-.. autoexception:: jinja2.UndefinedError
+.. autoexception:: ambari_jinja2.UndefinedError
 
 
-.. autoexception:: jinja2.TemplateNotFound
+.. autoexception:: ambari_jinja2.TemplateNotFound
 
 
-.. autoexception:: jinja2.TemplatesNotFound
+.. autoexception:: ambari_jinja2.TemplatesNotFound
 
 
-.. autoexception:: jinja2.TemplateSyntaxError
+.. autoexception:: ambari_jinja2.TemplateSyntaxError
 
 
     .. attribute:: message
     .. attribute:: message
 
 
@@ -551,7 +551,7 @@ Exceptions
     unicode strings is that Python 2.x is not using unicode for exceptions
     unicode strings is that Python 2.x is not using unicode for exceptions
     and tracebacks as well as the compiler.  This will change with Python 3.
     and tracebacks as well as the compiler.  This will change with Python 3.
 
 
-.. autoexception:: jinja2.TemplateAssertionError
+.. autoexception:: ambari_jinja2.TemplateAssertionError
 
 
 
 
 .. _writing-filters:
 .. _writing-filters:
@@ -593,7 +593,7 @@ paragraphs and marks the return value as safe HTML string if autoescaping is
 enabled::
 enabled::
 
 
     import re
     import re
-    from jinja2 import environmentfilter, Markup, escape
+    from ambari_jinja2 import environmentfilter, Markup, escape
 
 
     _paragraph_re = re.compile(r'(?:\r\n|\r|\n){2,}')
     _paragraph_re = re.compile(r'(?:\r\n|\r|\n){2,}')
 
 
@@ -659,7 +659,7 @@ must only happen with a :class:`nodes.EvalContextModifier` and
 :class:`nodes.ScopedEvalContextModifier` from an extension, not on the
 :class:`nodes.ScopedEvalContextModifier` from an extension, not on the
 eval context object itself.
 eval context object itself.
 
 
-.. autoclass:: jinja2.nodes.EvalContext
+.. autoclass:: ambari_jinja2.nodes.EvalContext
 
 
    .. attribute:: autoescape
    .. attribute:: autoescape
 
 
@@ -782,6 +782,6 @@ could help applications to implement more advanced template concepts.  All
 the functions of the meta API operate on an abstract syntax tree as
 the functions of the meta API operate on an abstract syntax tree as
 returned by the :meth:`Environment.parse` method.
 returned by the :meth:`Environment.parse` method.
 
 
-.. autofunction:: jinja2.meta.find_undeclared_variables
+.. autofunction:: ambari_jinja2.meta.find_undeclared_variables
 
 
-.. autofunction:: jinja2.meta.find_referenced_templates
+.. autofunction:: ambari_jinja2.meta.find_referenced_templates

+ 2 - 2
ambari-common/src/main/python/jinja2/docs/cache_extension.py → ambari-common/src/main/python/ambari_jinja2/docs/cache_extension.py

@@ -1,5 +1,5 @@
-from jinja2 import nodes
-from jinja2.ext import Extension
+from ambari_jinja2 import nodes
+from ambari_jinja2.ext import Extension
 
 
 
 
 class FragmentCacheExtension(Extension):
 class FragmentCacheExtension(Extension):

+ 3 - 0
ambari-common/src/main/python/ambari_jinja2/docs/changelog.rst

@@ -0,0 +1,3 @@
+.. module:: ambari_jinja2
+
+.. include:: ../CHANGES

+ 0 - 0
ambari-common/src/main/python/jinja2/docs/conf.py → ambari-common/src/main/python/ambari_jinja2/docs/conf.py


+ 23 - 23
ambari-common/src/main/python/jinja2/docs/extensions.rst → ambari-common/src/main/python/ambari_jinja2/docs/extensions.rst

@@ -17,7 +17,7 @@ extension pass a list of extension classes or import paths to the
 `environment` parameter of the :class:`Environment` constructor.  The following
 `environment` parameter of the :class:`Environment` constructor.  The following
 example creates a Jinja2 environment with the i18n extension loaded::
 example creates a Jinja2 environment with the i18n extension loaded::
 
 
-    jinja_env = Environment(extensions=['jinja2.ext.i18n'])
+    jinja_env = Environment(extensions=['ambari_jinja2.ext.i18n'])
 
 
 
 
 .. _i18n-extension:
 .. _i18n-extension:
@@ -25,7 +25,7 @@ example creates a Jinja2 environment with the i18n extension loaded::
 i18n Extension
 i18n Extension
 --------------
 --------------
 
 
-**Import name:** `jinja2.ext.i18n`
+**Import name:** `ambari_jinja2.ext.i18n`
 
 
 Jinja2 currently comes with one extension, the i18n extension.  It can be
 Jinja2 currently comes with one extension, the i18n extension.  It can be
 used in combination with `gettext`_ or `babel`_.  If the i18n extension is
 used in combination with `gettext`_ or `babel`_.  If the i18n extension is
@@ -43,7 +43,7 @@ Environment Methods
 After enabling of the extension the environment provides the following
 After enabling of the extension the environment provides the following
 additional methods:
 additional methods:
 
 
-.. method:: jinja2.Environment.install_gettext_translations(translations, newstyle=False)
+.. method:: ambari_jinja2.Environment.install_gettext_translations(translations, newstyle=False)
 
 
     Installs a translation globally for that environment.  The tranlations
     Installs a translation globally for that environment.  The tranlations
     object provided must implement at least `ugettext` and `ungettext`.
     object provided must implement at least `ugettext` and `ungettext`.
@@ -52,7 +52,7 @@ additional methods:
 
 
     .. versionchanged:: 2.5 newstyle gettext added
     .. versionchanged:: 2.5 newstyle gettext added
 
 
-.. method:: jinja2.Environment.install_null_translations(newstyle=False)
+.. method:: ambari_jinja2.Environment.install_null_translations(newstyle=False)
 
 
     Install dummy gettext functions.  This is useful if you want to prepare
     Install dummy gettext functions.  This is useful if you want to prepare
     the application for internationalization but don't want to implement the
     the application for internationalization but don't want to implement the
@@ -60,7 +60,7 @@ additional methods:
 
 
     .. versionchanged:: 2.5 newstyle gettext added
     .. versionchanged:: 2.5 newstyle gettext added
 
 
-.. method:: jinja2.Environment.install_gettext_callables(gettext, ngettext, newstyle=False)
+.. method:: ambari_jinja2.Environment.install_gettext_callables(gettext, ngettext, newstyle=False)
 
 
     Installs the given `gettext` and `ngettext` callables into the
     Installs the given `gettext` and `ngettext` callables into the
     environment as globals.  They are supposed to behave exactly like the
     environment as globals.  They are supposed to behave exactly like the
@@ -72,11 +72,11 @@ additional methods:
 
 
     .. versionadded:: 2.5
     .. versionadded:: 2.5
 
 
-.. method:: jinja2.Environment.uninstall_gettext_translations()
+.. method:: ambari_jinja2.Environment.uninstall_gettext_translations()
 
 
     Uninstall the translations again.
     Uninstall the translations again.
 
 
-.. method:: jinja2.Environment.extract_translations(source)
+.. method:: ambari_jinja2.Environment.extract_translations(source)
 
 
     Extract localizable strings from the given template node or source.
     Extract localizable strings from the given template node or source.
 
 
@@ -98,7 +98,7 @@ installed for a French community) may load the translations once and add the
 translation methods to the environment at environment generation time::
 translation methods to the environment at environment generation time::
 
 
     translations = get_gettext_translations()
     translations = get_gettext_translations()
-    env = Environment(extensions=['jinja2.ext.i18n'])
+    env = Environment(extensions=['ambari_jinja2.ext.i18n'])
     env.install_gettext_translations(translations)
     env.install_gettext_translations(translations)
 
 
 The `get_gettext_translations` function would return the translator for the
 The `get_gettext_translations` function would return the translator for the
@@ -160,7 +160,7 @@ templates are experiencing over time when using autoescaping.
 Expression Statement
 Expression Statement
 --------------------
 --------------------
 
 
-**Import name:** `jinja2.ext.do`
+**Import name:** `ambari_jinja2.ext.do`
 
 
 The "do" aka expression-statement extension adds a simple `do` tag to the
 The "do" aka expression-statement extension adds a simple `do` tag to the
 template engine that works like a variable expression but ignores the
 template engine that works like a variable expression but ignores the
@@ -171,7 +171,7 @@ return value.
 Loop Controls
 Loop Controls
 -------------
 -------------
 
 
-**Import name:** `jinja2.ext.loopcontrols`
+**Import name:** `ambari_jinja2.ext.loopcontrols`
 
 
 This extension adds support for `break` and `continue` in loops.  After
 This extension adds support for `break` and `continue` in loops.  After
 enabling Jinja2 provides those two keywords which work exactly like in
 enabling Jinja2 provides those two keywords which work exactly like in
@@ -182,7 +182,7 @@ Python.
 With Statement
 With Statement
 --------------
 --------------
 
 
-**Import name:** `jinja2.ext.with_`
+**Import name:** `ambari_jinja2.ext.with_`
 
 
 .. versionadded:: 2.3
 .. versionadded:: 2.3
 
 
@@ -196,7 +196,7 @@ standard `set` statement directly within.
 Autoescape Extension
 Autoescape Extension
 --------------------
 --------------------
 
 
-**Import name:** `jinja2.ext.autoescape`
+**Import name:** `ambari_jinja2.ext.autoescape`
 
 
 .. versionadded:: 2.4
 .. versionadded:: 2.4
 
 
@@ -211,7 +211,7 @@ deactivated.  The setting overriding is scoped.
 Writing Extensions
 Writing Extensions
 ------------------
 ------------------
 
 
-.. module:: jinja2.ext
+.. module:: ambari_jinja2.ext
 
 
 By writing extensions you can add custom tags to Jinja2.  This is a non trival
 By writing extensions you can add custom tags to Jinja2.  This is a non trival
 task and usually not needed as the default tags and expressions cover all
 task and usually not needed as the default tags and expressions cover all
@@ -236,7 +236,7 @@ The following example implements a `cache` tag for Jinja2 by using the
 
 
 And here is how you use it in an environment::
 And here is how you use it in an environment::
 
 
-    from jinja2 import Environment
+    from ambari_jinja2 import Environment
     from werkzeug.contrib.cache import SimpleCache
     from werkzeug.contrib.cache import SimpleCache
 
 
     env = Environment(extensions=[FragmentCacheExtension])
     env = Environment(extensions=[FragmentCacheExtension])
@@ -258,7 +258,7 @@ following example caches a sidebar for 300 seconds:
 Extension API
 Extension API
 ~~~~~~~~~~~~~
 ~~~~~~~~~~~~~
 
 
-Extensions always have to extend the :class:`jinja2.ext.Extension` class:
+Extensions always have to extend the :class:`ambari_jinja2.ext.Extension` class:
 
 
 .. autoclass:: Extension
 .. autoclass:: Extension
     :members: preprocess, filter_stream, parse, attr, call_method
     :members: preprocess, filter_stream, parse, attr, call_method
@@ -280,7 +280,7 @@ The parser passed to :meth:`Extension.parse` provides ways to parse
 expressions of different types.  The following methods may be used by
 expressions of different types.  The following methods may be used by
 extensions:
 extensions:
 
 
-.. autoclass:: jinja2.parser.Parser
+.. autoclass:: ambari_jinja2.parser.Parser
     :members: parse_expression, parse_tuple, parse_assign_target,
     :members: parse_expression, parse_tuple, parse_assign_target,
               parse_statements, free_identifier, fail
               parse_statements, free_identifier, fail
 
 
@@ -297,16 +297,16 @@ extensions:
 
 
     .. attribute:: stream
     .. attribute:: stream
 
 
-        The current :class:`~jinja2.lexer.TokenStream`
+        The current :class:`~ambari_jinja2.lexer.TokenStream`
 
 
-.. autoclass:: jinja2.lexer.TokenStream
+.. autoclass:: ambari_jinja2.lexer.TokenStream
    :members: push, look, eos, skip, next, next_if, skip_if, expect
    :members: push, look, eos, skip, next, next_if, skip_if, expect
 
 
    .. attribute:: current
    .. attribute:: current
 
 
-        The current :class:`~jinja2.lexer.Token`.
+        The current :class:`~ambari_jinja2.lexer.Token`.
 
 
-.. autoclass:: jinja2.lexer.Token
+.. autoclass:: ambari_jinja2.lexer.Token
     :members: test, test_any
     :members: test, test_any
 
 
     .. attribute:: lineno
     .. attribute:: lineno
@@ -325,7 +325,7 @@ extensions:
 There is also a utility function in the lexer module that can count newline
 There is also a utility function in the lexer module that can count newline
 characters in strings:
 characters in strings:
 
 
-.. autofunction:: jinja2.lexer.count_newlines
+.. autofunction:: ambari_jinja2.lexer.count_newlines
 
 
 AST
 AST
 ~~~
 ~~~
@@ -338,9 +338,9 @@ execute custom Python code.
 The list below describes all nodes that are currently available.  The AST may
 The list below describes all nodes that are currently available.  The AST may
 change between Jinja2 versions but will stay backwards compatible.
 change between Jinja2 versions but will stay backwards compatible.
 
 
-For more information have a look at the repr of :meth:`jinja2.Environment.parse`.
+For more information have a look at the repr of :meth:`ambari_jinja2.Environment.parse`.
 
 
-.. module:: jinja2.nodes
+.. module:: ambari_jinja2.nodes
 
 
 .. jinjanodes::
 .. jinjanodes::
 
 

+ 0 - 0
ambari-common/src/main/python/jinja2/docs/faq.rst → ambari-common/src/main/python/ambari_jinja2/docs/faq.rst


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/index.rst → ambari-common/src/main/python/ambari_jinja2/docs/index.rst


+ 4 - 4
ambari-common/src/main/python/jinja2/docs/integration.rst → ambari-common/src/main/python/ambari_jinja2/docs/integration.rst

@@ -11,7 +11,7 @@ Babel Integration
 -----------------
 -----------------
 
 
 Jinja provides support for extracting gettext messages from templates via a
 Jinja provides support for extracting gettext messages from templates via a
-`Babel`_ extractor entry point called `jinja2.ext.babel_extract`.  The Babel
+`Babel`_ extractor entry point called `ambari_jinja2.ext.babel_extract`.  The Babel
 support is implemented as part of the :ref:`i18n-extension` extension.
 support is implemented as part of the :ref:`i18n-extension` extension.
 
 
 Gettext messages extracted from both `trans` tags and code expressions.
 Gettext messages extracted from both `trans` tags and code expressions.
@@ -21,7 +21,7 @@ in its Babel extraction method `mapping file`_:
 
 
 .. sourcecode:: ini
 .. sourcecode:: ini
 
 
-    [jinja2: **/templates/**.html]
+    [ambari_jinja2: **/templates/**.html]
     encoding = utf-8
     encoding = utf-8
 
 
 The syntax related options of the :class:`Environment` are also available as
 The syntax related options of the :class:`Environment` are also available as
@@ -30,7 +30,7 @@ that templates use ``%`` as `line_statement_prefix` you can use this code:
 
 
 .. sourcecode:: ini
 .. sourcecode:: ini
 
 
-    [jinja2: **/templates/**.html]
+    [ambari_jinja2: **/templates/**.html]
     encoding = utf-8
     encoding = utf-8
     line_statement_prefix = %
     line_statement_prefix = %
 
 
@@ -49,7 +49,7 @@ Pylons powered application.
 The template engine is configured in `config/environment.py`.  The configuration
 The template engine is configured in `config/environment.py`.  The configuration
 for Jinja2 looks something like that::
 for Jinja2 looks something like that::
 
 
-    from jinja2 import Environment, PackageLoader
+    from ambari_jinja2 import Environment, PackageLoader
     config['pylons.app_globals'].jinja_env = Environment(
     config['pylons.app_globals'].jinja_env = Environment(
         loader=PackageLoader('yourapplication', 'templates')
         loader=PackageLoader('yourapplication', 'templates')
     )
     )

+ 8 - 8
ambari-common/src/main/python/jinja2/docs/intro.rst → ambari-common/src/main/python/ambari_jinja2/docs/intro.rst

@@ -80,9 +80,9 @@ Installing the development version
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
 1.  Install `git`_
 1.  Install `git`_
-2.  ``git clone git://github.com/mitsuhiko/jinja2.git``
-3.  ``cd jinja2``
-4.  ``ln -s jinja2 /usr/lib/python2.X/site-packages``
+2.  ``git clone git://github.com/mitsuhiko/ambari_jinja2.git``
+3.  ``cd ambari_jinja2``
+4.  ``ln -s ambari_jinja2 /usr/lib/python2.X/site-packages``
 
 
 As an alternative to steps 4 you can also do ``python setup.py develop``
 As an alternative to steps 4 you can also do ``python setup.py develop``
 which will install the package via distribute in development mode.  This also
 which will install the package via distribute in development mode.  This also
@@ -132,17 +132,17 @@ This section gives you a brief introduction to the Python API for Jinja2
 templates.
 templates.
 
 
 The most basic way to create a template and render it is through
 The most basic way to create a template and render it is through
-:class:`~jinja2.Template`.  This however is not the recommended way to
+:class:`~ambari_jinja2.Template`.  This however is not the recommended way to
 work with it if your templates are not loaded from strings but the file
 work with it if your templates are not loaded from strings but the file
 system or another data source:
 system or another data source:
 
 
->>> from jinja2 import Template
+>>> from ambari_jinja2 import Template
 >>> template = Template('Hello {{ name }}!')
 >>> template = Template('Hello {{ name }}!')
 >>> template.render(name='John Doe')
 >>> template.render(name='John Doe')
 u'Hello John Doe!'
 u'Hello John Doe!'
 
 
-By creating an instance of :class:`~jinja2.Template` you get back a new template
-object that provides a method called :meth:`~jinja2.Template.render` which when
+By creating an instance of :class:`~ambari_jinja2.Template` you get back a new template
+object that provides a method called :meth:`~ambari_jinja2.Template.render` which when
 called with a dict or keyword arguments expands the template.  The dict
 called with a dict or keyword arguments expands the template.  The dict
 or keywords arguments passed to the template are the so-called "context"
 or keywords arguments passed to the template are the so-called "context"
 of the template.
 of the template.
@@ -165,4 +165,4 @@ in mind, you will have to adapt the shown code examples to Python 3 syntax
 for yourself.
 for yourself.
 
 
 
 
-.. _Jinja bug tracker: http://github.com/mitsuhiko/jinja2/issues
+.. _Jinja bug tracker: http://github.com/mitsuhiko/ambari_jinja2/issues

+ 4 - 4
ambari-common/src/main/python/jinja2/docs/jinjaext.py → ambari-common/src/main/python/ambari_jinja2/docs/jinjaext.py

@@ -11,7 +11,7 @@
 import os
 import os
 import re
 import re
 import inspect
 import inspect
-import jinja2
+import ambari_jinja2
 from itertools import islice
 from itertools import islice
 from types import BuiltinFunctionType
 from types import BuiltinFunctionType
 from docutils import nodes
 from docutils import nodes
@@ -21,7 +21,7 @@ from sphinx.application import TemplateBridge
 from pygments.style import Style
 from pygments.style import Style
 from pygments.token import Keyword, Name, Comment, String, Error, \
 from pygments.token import Keyword, Name, Comment, String, Error, \
      Number, Operator, Generic
      Number, Operator, Generic
-from jinja2 import Environment, FileSystemLoader
+from ambari_jinja2 import Environment, FileSystemLoader
 
 
 
 
 def parse_rst(state, content_offset, doc):
 def parse_rst(state, content_offset, doc):
@@ -129,14 +129,14 @@ def dump_functions(mapping):
     return directive
     return directive
 
 
 
 
-from jinja2.defaults import DEFAULT_FILTERS, DEFAULT_TESTS
+from ambari_jinja2.defaults import DEFAULT_FILTERS, DEFAULT_TESTS
 jinja_filters = dump_functions(DEFAULT_FILTERS)
 jinja_filters = dump_functions(DEFAULT_FILTERS)
 jinja_tests = dump_functions(DEFAULT_TESTS)
 jinja_tests = dump_functions(DEFAULT_TESTS)
 
 
 
 
 def jinja_nodes(dirname, arguments, options, content, lineno,
 def jinja_nodes(dirname, arguments, options, content, lineno,
                 content_offset, block_text, state, state_machine):
                 content_offset, block_text, state, state_machine):
-    from jinja2.nodes import Node
+    from ambari_jinja2.nodes import Node
     doc = ViewList()
     doc = ViewList()
     def walk(node, indent):
     def walk(node, indent):
         p = ' ' * indent
         p = ' ' * indent

+ 1 - 1
ambari-common/src/main/python/jinja2/docs/sandbox.rst → ambari-common/src/main/python/ambari_jinja2/docs/sandbox.rst

@@ -15,7 +15,7 @@ Traceback (most recent call last):
 SecurityError: access to attribute 'func_code' of 'function' object is unsafe.
 SecurityError: access to attribute 'func_code' of 'function' object is unsafe.
 
 
 
 
-.. module:: jinja2.sandbox
+.. module:: ambari_jinja2.sandbox
 
 
 .. autoclass:: SandboxedEnvironment([options])
 .. autoclass:: SandboxedEnvironment([options])
     :members: is_safe_attribute, is_safe_callable
     :members: is_safe_attribute, is_safe_callable

+ 0 - 0
ambari-common/src/main/python/jinja2/docs/switching.rst → ambari-common/src/main/python/ambari_jinja2/docs/switching.rst


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/templates.rst → ambari-common/src/main/python/ambari_jinja2/docs/templates.rst


+ 0 - 0
ambari-common/src/main/python/jinja2/docs/tricks.rst → ambari-common/src/main/python/ambari_jinja2/docs/tricks.rst


+ 1 - 1
ambari-common/src/main/python/jinja2/examples/basic/cycle.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/cycle.py

@@ -1,4 +1,4 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
 
 
 
 env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}")
 env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}")

+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/debugger.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/debugger.py

@@ -1,5 +1,5 @@
-from jinja2 import Environment
-from jinja2.loaders import FileSystemLoader
+from ambari_jinja2 import Environment
+from ambari_jinja2.loaders import FileSystemLoader
 
 
 env = Environment(loader=FileSystemLoader('templates'))
 env = Environment(loader=FileSystemLoader('templates'))
 
 

+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/inheritance.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/inheritance.py

@@ -1,5 +1,5 @@
-from jinja2 import Environment
-from jinja2.loaders import DictLoader
+from ambari_jinja2 import Environment
+from ambari_jinja2.loaders import DictLoader
 
 
 
 
 env = Environment(loader=DictLoader({
 env = Environment(loader=DictLoader({

+ 0 - 0
ambari-common/src/main/python/jinja2/examples/basic/templates/broken.html → ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/broken.html


+ 0 - 0
ambari-common/src/main/python/jinja2/examples/basic/templates/subbroken.html → ambari-common/src/main/python/ambari_jinja2/examples/basic/templates/subbroken.html


+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/test.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/test.py

@@ -1,5 +1,5 @@
-from jinja2 import Environment
-from jinja2.loaders import DictLoader
+from ambari_jinja2 import Environment
+from ambari_jinja2.loaders import DictLoader
 
 
 env = Environment(loader=DictLoader({
 env = Environment(loader=DictLoader({
 'child.html': u'''\
 'child.html': u'''\

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/basic/test_filter_and_linestatements.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/test_filter_and_linestatements.py

@@ -1,4 +1,4 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
 
 
 
 env = Environment(line_statement_prefix='%', variable_start_string="${", variable_end_string="}")
 env = Environment(line_statement_prefix='%', variable_start_string="${", variable_end_string="}")

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/basic/test_loop_filter.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/test_loop_filter.py

@@ -1,4 +1,4 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
 
 tmpl = Environment().from_string("""\
 tmpl = Environment().from_string("""\
 <ul>
 <ul>

+ 2 - 2
ambari-common/src/main/python/jinja2/examples/basic/translate.py → ambari-common/src/main/python/ambari_jinja2/examples/basic/translate.py

@@ -1,6 +1,6 @@
-from jinja2 import Environment
+from ambari_jinja2 import Environment
 
 
-print Environment(extensions=['jinja2.i18n.TransExtension']).from_string("""\
+print Environment(extensions=['ambari_jinja2.i18n.TransExtension']).from_string("""\
 {% trans %}Hello {{ user }}!{% endtrans %}
 {% trans %}Hello {{ user }}!{% endtrans %}
 {% trans count=users|count %}{{ count }} user{% pluralize %}{{ count }} users{% endtrans %}
 {% trans count=users|count %}{{ count }} user{% pluralize %}{{ count }} users{% endtrans %}
 """).render(user="someone")
 """).render(user="someone")

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/bench.py → ambari-common/src/main/python/ambari_jinja2/examples/bench.py

@@ -6,7 +6,7 @@
 import sys
 import sys
 import cgi
 import cgi
 from timeit import Timer
 from timeit import Timer
-from jinja2 import Environment as JinjaEnvironment
+from ambari_jinja2 import Environment as JinjaEnvironment
 
 
 context = {
 context = {
     'page_title': 'mitsuhiko\'s benchmark',
     'page_title': 'mitsuhiko\'s benchmark',

+ 1 - 1
ambari-common/src/main/python/jinja2/examples/profile.py → ambari-common/src/main/python/ambari_jinja2/examples/profile.py

@@ -3,7 +3,7 @@ try:
 except ImportError:
 except ImportError:
     from profile import Profile
     from profile import Profile
 from pstats import Stats
 from pstats import Stats
-from jinja2 import Environment as JinjaEnvironment
+from ambari_jinja2 import Environment as JinjaEnvironment
 
 
 context = {
 context = {
     'page_title': 'mitsuhiko\'s benchmark',
     'page_title': 'mitsuhiko\'s benchmark',

+ 0 - 0
ambari-common/src/main/python/jinja2/examples/rwbench/django/_form.html → ambari-common/src/main/python/ambari_jinja2/examples/rwbench/django/_form.html


Some files were not shown because too many files changed in this diff