Skip to content

Instantly share code, notes, and snippets.

@kellyjonbrazil
kellyjonbrazil / jc.py
Created Sep 15, 2020
Saltstack JC Serializer
View jc.py
"""
salt.serializers.jc
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements JC serializer.
JC converts the output of many commands and file-types to structured format.
https://github.com/kellyjonbrazil/jc
Requires JC is installed via pip: $ pip3 install jc
Requires Python >= 3.6
@kellyjonbrazil
kellyjonbrazil / jc.py
Last active Sep 15, 2020
Saltstack JC Outputter
View jc.py
# -*- coding: utf-8 -*-
"""
JC Outputter for Salt
JC converts the output of many commands and file-types to structured format.
https://github.com/kellyjonbrazil/jc
Requires JC is installed via pip: $ pip3 install jc
Requires Python >= 3.6
Usage:
This outputter requires a parser to be defined via the JC_PARSER env variable:
@kellyjonbrazil
kellyjonbrazil / tracebackplus.py
Last active Jul 8, 2020
Python Tracebackplus
View tracebackplus.py
"""More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import tracebackplus; tracebackplus.enable()
at the top of your script. The optional arguments to enable() are:
logdir - if set, tracebacks are written to files in this directory
context - number of lines of source code to show for each stack frame
You can’t perform that action at this time.