You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resub and resuball function can reference regex patterns from template vars
exact_space match variable indicator
Added group record function
Added group set function
Added support to groups for absolute path
Added support for filter list to ttp.add_template method, to allow filtering of child templates that need to be loaded from text file that contains several templates or from template that has child tags defined, filter contains names of child templates to be loaded
Added filter support for parent templates names, now they can be filtered as well - if no name of template specified in filter, that template content will be ignored and no results produced
Added gpvlookup to lookup match results against glob patterns
Added support for geoip2 db lookups - geoip_lookup match variable function
Added support for lookup tag databse loaders
Added match variable geoip_lookup function
Added support for group contains_val and exclude_val to reference variable;
Added support for match variable equal, non_equal and cidr_match to reference variable;
Added cli tool -v/--vars keyword to supply json string-dictionary of variables to add to ttp parser object
Added colouring to terminal returner using colorama
Added group validate function that used Cerberus to check group result
Modified outputter validate function to have features similar to group validate function
Match variable function equal/notequal/exclude/append/prepend/contains/replaceall can reference Template variables
Added TTP variable get_timestamp_iso function
Added support for flat_list result structure to flatten overall results
Added group 'expand' function to expand dot separated variables names to nested dictionary
Added 'clear_result' method to ttp parser object
Added outputter support for N2G formatter to produce xml diagrams
Added group lookup function
added support for "doc" tag - TTP will not complain about it and this tag can be used to put template description in it
Added support for group functions to reference list of functions in template variable using chain or functions attribute
Added default name to templates - "root_template", added template_name attribute to add_input, set_input, clear_input methods; get_inout_load method now returns dictionary of templates and input names.
Added syslog returner to outputs using logging syslog handler to return results to syslog server over udp
Added support for netmiko as an input source function
Added support for "headers" indicator to dynamically construct regexes line to match tabulated data using exact number of spaces
Added support for Nornir as an input source
Added reference to variables for match variable conditional functions to introduce dynamic filtering capabilities
CHANGES
Modified variable and pattern line escaping behavior, to fix bug with several match variables with digits in name e.g. d1_1, d1_2
Modified behavior of DEFAULTS handling in results object to add them at the very end and make them the least preferred in comparison to results values.
Modified per_template results method handling to flatten results structure by converting overall result to dictionary for named groups and using single list for anonymous group
Results object processgrp now adds default to results instead of save_results method
Updated template object form results to handle anonymous and named groups so that results for both groups included in output
Deleted get_input_commands_list and get_input_commands_dict parser objects, as they no longer deemed to be useful
Data on add associated with templates straight away instead of being saved in ttp.__data list. As a result, templates must be added before data will be added, if data added before template, that data will not be processed, as there are not templates/inputs to associate it with.
Outputters now load tag data and merge it with attributes if its a dictionary.
TESTS
test1-48 for variable with digits in name and for exact indicator
Test 1-50-x for group record and set functions
Test 1-51 to test group absolute path handling
Test 1-52 to test let vs set behavior when defaults must be overridden by match values
Test 1-53 for exact_space indicator
Test 29-1 and 29-2 gpvlookup tests
Test 1-50 for group macro attribute with comma separated macro names
Added tests 1-56, 1-57 to test match cidr_match and group contains_val functions referencing to variable
Test 1-58 to test group validate function
Results forming for template with anonymous and named group to test change-5
Started moving tests to pytest - 31 tests added so far
DOCS
Added HOWTO for parsing text data structured in tables
Added docs for group record and set functions
Added docs for group absolute path
Added docs to 'ignore' indicator saying that regex can come from re patterns or from template variables
Added docs to cli tool about new keywords options -ot and -s
Added docs about exact_space indicator
Added docs for gpvlookup match variable function
Added docs for geoip_lookup function
Updated docs for group contains_val and exclude_val, for match variable equal, non_equal and cidr_match to mention that they can reference variable
Added docs for group 'expand' function
Updated docstring for 'flat_list' structure
Flattened docs structure, created separate section for results structure
Wrote docs for headers indicator
Updated summary notes to installation page for other packages to be installed for certain features to work
Documented N2G output formatter
Changed output formatters to include all supported arguments within each of them, rather then having separate section for formatter's attributes.
Added new cli tool -v/--vars argument in the docs
Added docs about coloring terminal returner output using colorama
Modified inputs docs - merged attributes and parameters together
Added docs for syslog returner
Added docs for netmiko source
Added docs about Norninr source
Added docs about group validate function
BUGS
fixed bug with get_attributes function when empty match variable item give e.g. {{ var | | func }}
Fixed bug for variables having digit in name, that digit was substituted with \d+ pattern, resulting in match varibales have the same name, which is prohibited for regex groups
Fixed bug for py2.7 struct load for exec() function when text contains "True" of "False" by skipping the error, as exec chokes on it while eval used to load it. Not an issue in py3 though.
Fixed problem with set overriding let values due to default values override results dictionary when group method="table" and we have dynamic path in use to form dictionary, override happen due to the fact that each match was written to results straight away together with defaults values and if we have let function and unconditional set (set to defaults) values for same variable, let value was overridden by defaults from set.
Fixed handling of absolute path together with anonymous parent group
Fixed template form_results function to handle the case when anonymous group produces dictionary results in per_template mode
Load struct function was fixed to correctly handle the case when template vars tag has include attribute but has not text defined in XML element
Fixed traceback display issue with get_attributes function, log string had wrong formatting
Fixed truncate function and added test to test it
10.Fixed issue with group macro having several macro names separated by comma, added test to test it
TTP duplicate logs when used as a module - changed log config function
Fixed bug with anonymous template introduced by adding r'' raw strings
Fixed csv formatter results handling when they contains integers
Fixed this bug:
interface {{ interface }}
description {{ description | ORPHRASE }}
was returning no results for interfaces without descriptions
15. Fixed CSV formatter to handle "," properly in matches, by vrapping items in '"' or "'" characters