示例#1
0
文件: main.py 项目: evisb/heat2arm
def main():
    """ main is the entry point of the application. """
    args = _parse_args()

    if args.config_file:
        CONF(["--config-file", args.config_file])

    heat_template_data = args.heat_template.read()
    args.heat_template.close()

    arm_template_data = engine.convert_template(heat_template_data)

    args.arm_template.write(json.dumps(arm_template_data, indent=4))
    args.arm_template.close()
示例#2
0
def main():
    """ main is the entry point of the application. """
    _setup_logging()

    args = _parse_args()
    if args.config_file:
        CONF(["--config-file", args.config_file])

    heat_template_data = yaml.load(args.heat_template, Loader=yaml.BaseLoader)
    args.heat_template.close()

    arm_template_data = engine.convert_template(heat_template_data)

    args.arm_template.write(json.dumps(arm_template_data, indent=4))
    args.arm_template.close()
示例#3
0
def main():
    """ main is the entry point of the application. """
    _setup_logging()

    args = _parse_args()
    if args.config_file:
        CONF(["--config-file", args.config_file])

    if args.api_version:
        constants.ARM_API_VERSION = args.api_version

    heat_template_data = yaml.load(args.heat_template, Loader=yaml.BaseLoader)
    args.heat_template.close()

    arm_template_data = engine.convert_template(heat_template_data)

    args.arm_template.write(json.dumps(arm_template_data, indent=4))
    args.arm_template.close()
示例#4
0
def main():
    """ main is the entry point of the application. """
    args = _parse_args()

    # first; check for a config file and load it:
    if args.config_file:
        CONF(["--config-file", args.config_file])

    # setup logging:
    _setup_logging(args.logfile, args.loglevel)

    # read the contents of the template:
    heat_template_data = args.heat_template.read()
    args.heat_template.close()

    # do the conversion:
    arm_template_data = engine.convert_template(heat_template_data)

    # write out the result:
    args.arm_template.write(json.dumps(arm_template_data, indent=4))
    args.arm_template.close()