LinchPin Extra Modules¶
These are modules not documented elsewhere in the LinchPin API, but may be useful to a developer.
-
class
linchpin.utils.dataparser.
DataParser
¶ -
load_pinfile
(pinfile)¶
-
parse_json_yaml
(data, ordered=True)¶ parses yaml file into json object
-
process
(file_w_path, data=None)¶ Processes the PinFile and any data (if a template) using Jinja2. Returns json of PinFile, topology, layout, and hooks.
- Parameters
file_w_path – Full path to the provided file to process
data – A JSON representation of data mapped to a Jinja2 template in file_w_path
-
render
(template, context, ordered=True)¶ Performs the rendering of template and context data using Jinja2.
- Parameters
template – Full path to the Jinja2 template
context – A dictionary of variables to be rendered againt the template
-
run_script
(script)¶
-
write_json
(provision_data, pf_outfile)¶
-
-
exception
linchpin.exceptions.
ActionError
(*args, **kwargs)¶
-
exception
linchpin.exceptions.
ActionManagerError
(*args, **kwargs)¶
-
exception
linchpin.exceptions.
HookError
(*args, **kwargs)¶
-
exception
linchpin.exceptions.
LinchpinError
(*args, **kwargs)¶
-
exception
linchpin.exceptions.
SchemaError
(*args, **kwargs)¶
-
exception
linchpin.exceptions.
StateError
(*args, **kwargs)¶
-
exception
linchpin.exceptions.
TopologyError
(*args, **kwargs)¶
-
exception
linchpin.exceptions.
ValidationError
(*args, **kwargs)¶
-
class
linchpin.exceptions.
ValidationErrorHandler
(tree=None)¶ -
messages
= {0: '{0}', 1: 'document is missing', 2: "field '{field}' is required", 3: "field '{field}' could not be recognized within the schema provided", 4: "field '{0}' is required", 5: 'depends on these values: {constraint}', 6: "{0} must not be present with '{field}'", 33: "'{0}' is not a document, must be a dict", 34: 'empty values not allowed', 35: 'null value not allowed', 36: "value for field '{field}' must be of type '{constraint}'", 37: 'must be of dict type', 38: 'length of list should be {0}, it is {1}', 39: 'min length is {constraint}', 40: 'max length is {constraint}', 65: "value does not match regex '{constraint}'", 66: 'min value is {constraint}', 67: 'max value is {constraint}', 68: "unallowed value '{value}' for field '{field}'. Allowed values are: {constraint}", 69: 'unallowed values {0}', 70: 'unallowed value {value}', 71: 'unallowed values {0}', 72: 'missing members {0}', 97: "field '{field}' cannot be coerced: {0}", 98: "field '{field}' cannot be renamed: {0}", 99: 'field is read-only', 100: "default value for '{field}' cannot be set: {0}", 129: "mapping doesn't validate subschema: {0}", 130: "one or more sequence-items don't validate: {0}", 131: "one or more keys of a mapping don't validate: {0}", 132: "one or more values in a mapping don't validate: {0}", 133: "one or more sequence-items don't validate: {0}", 145: 'one or more definitions validate', 146: 'none or more than one rule validate', 147: 'no definitions validate', 148: "one or more definitions don't validate"}¶
-