def write_environment_info(stackname, overwrite=False):
"""Looks for /etc/cfn-info.json and writes one if not found.
Must be called with an active stack connection.
This gives Salt the outputs available at stack creation, but that were not
available at template compilation time.
"""
if not files.exists("/etc/cfn-info.json") or overwrite:
LOG.info('no cfn outputs found or overwrite=True, writing /etc/cfn-info.json ...')
infr_config = utils.json_dumps(template_info(stackname))
return put(StringIO(infr_config), "/etc/cfn-info.json", use_sudo=True)
LOG.debug('cfn outputs found, skipping')
return []
#
#
#
评论列表
文章目录