mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Move jinja template files into salt/templates
See #7291. This is the first step.
This commit is contained in:
parent
b3b915c41f
commit
8960189d22
8 changed files with 9 additions and 3 deletions
|
@ -16,14 +16,16 @@ import jinja2.exceptions
|
|||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
from salt.modules import __path__ as saltmodpath
|
||||
import salt.utils.templates
|
||||
|
||||
# Set up logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
# Set up template environment
|
||||
ENV = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader(saltmodpath[0] + os.sep + 'rh_ip')
|
||||
loader=jinja2.FileSystemLoader(
|
||||
os.path.join(salt.utils.templates.TEMPLATE_DIRNAME, 'rh_ip')
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ import salt.utils
|
|||
import salt.exceptions
|
||||
from salt.utils.jinja import SaltCacheLoader as JinjaSaltCacheLoader
|
||||
from salt.utils.jinja import SerializerExtension as JinjaSerializerExtension
|
||||
from salt import __path__ as saltpath
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -31,6 +33,8 @@ class SaltTemplateRenderError(salt.exceptions.SaltException):
|
|||
pass
|
||||
|
||||
|
||||
TEMPLATE_DIRNAME = os.path.join(saltpath[0], 'templates')
|
||||
|
||||
# FIXME: also in salt/template.py
|
||||
SLS_ENCODING = 'utf-8' # this one has no BOM.
|
||||
SLS_ENCODER = codecs.getencoder(SLS_ENCODING)
|
||||
|
|
2
setup.py
2
setup.py
|
@ -311,7 +311,7 @@ SETUP_KWARGS = {'name': NAME,
|
|||
'salt.log',
|
||||
'salt.log.handlers',
|
||||
],
|
||||
'package_data': {'salt.modules': ['rh_ip/*.jinja']},
|
||||
'package_data': {'salt.templates': ['rh_ip/*.jinja']},
|
||||
'data_files': [('share/man/man1',
|
||||
['doc/man/salt-master.1',
|
||||
'doc/man/salt-key.1',
|
||||
|
|
Loading…
Add table
Reference in a new issue