def __get_linesof_script(self, script):
format = script['format'] # type: ScriptFormat
shellscript = script['script'] # type: str
if format is ScriptFormat.PUPPET:
tpl = self.__load_resource(pkg_resources.resource_string, self, 'puppet-apply.sh') \
.decode("utf-8")
f = NamedTemporaryFile(delete=False)
tmpfilename = f.name
f.close()
os.unlink(f.name)
tpl = AtTemplate(tpl)
shellscript = tpl.substitute(dict(tmpfilename=tmpfilename, pp=shellscript))
return shellscript.split("\n")
评论列表
文章目录