示例#1
0
def _build_node_def_body(env, classes):
    contents = ""
    properties = build_properties(env, "puppet")
    contents += "\n".join(["$%s = '%s'" % (key, value.replace("'", r"\'")) for key, value in properties.iteritems()])
    contents += "\n"
    contents += "\n".join([_build_class_include(env, class_name) for class_name in classes])
    return contents
示例#2
0
def _build_chef_properties(env, config_file):
    """
    Build python object representation of the Chef-solo node.json file from
    node_extra.json in config dir and the fabric environment.
    """

    json_properties = _parse_json(config_file)
    return build_properties(env, "chef", json_properties)
示例#3
0
def _build_chef_properties(env, config_file):
    """
    Build python object representation of the Chef-solo node.json file from
    node_extra.json in config dir and the fabric environment.
    """

    json_properties = _parse_json(config_file)
    return build_properties(env, "chef", json_properties)