mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Cloud map template rendering fixed.
This commit is contained in:
parent
a566e2829c
commit
6d6bba9e7c
@ -38,6 +38,7 @@ log = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
from mako.template import Template
|
||||
from mako.exceptions import MakoException
|
||||
except ImportError:
|
||||
log.debug('Mako not available')
|
||||
|
||||
@ -954,10 +955,11 @@ class Map(Cloud):
|
||||
with open(self.opts['map'], 'rb') as fp_:
|
||||
try:
|
||||
# open mako file
|
||||
temp_ = Template(open(fp_, 'r').read())
|
||||
temp_ = Template(fp_.read())
|
||||
# render as yaml
|
||||
map_ = temp_.render()
|
||||
except Exception:
|
||||
yaml_str_ = temp_.render()
|
||||
map_ = yaml.safe_load(yaml_str_)
|
||||
except MakoException:
|
||||
map_ = yaml.safe_load(fp_.read())
|
||||
except Exception as exc:
|
||||
log.error(
|
||||
|
Loading…
Reference in New Issue
Block a user