Changed some functions names and added _print_debug for all modules
This commit is contained in:
parent
6d62c38ee1
commit
0fed9f8749
|
@ -27,6 +27,20 @@ BSD = FREEBSD or OPENBSD or NETBSD
|
|||
SUNOS = sys.platform.startswith(("sunos", "solaris"))
|
||||
AIX = sys.platform.startswith("aix")
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Set a global variable with the specified name and assigns a value to it.
|
||||
#########################################################################################
|
||||
|
|
|
@ -10,10 +10,24 @@ SUMMARY = {}
|
|||
INFO = ""
|
||||
MONITORING_DATA = []
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Set error level to value
|
||||
#########################################################################################
|
||||
def set_error_level(
|
||||
def set_disco_error_level(
|
||||
value: int = 0
|
||||
):
|
||||
"""
|
||||
|
@ -29,7 +43,7 @@ def set_error_level(
|
|||
####
|
||||
# Set fixed value to summary key
|
||||
#########################################################################################
|
||||
def set_summary_value(
|
||||
def set_disco_summary_value(
|
||||
key: str = "",
|
||||
value = None
|
||||
):
|
||||
|
@ -47,7 +61,7 @@ def set_summary_value(
|
|||
####
|
||||
# Add value to summary key
|
||||
#########################################################################################
|
||||
def add_summary_value(
|
||||
def add_disco_summary_value(
|
||||
key: str = "",
|
||||
value = None
|
||||
):
|
||||
|
@ -70,7 +84,7 @@ def add_summary_value(
|
|||
####
|
||||
# Set fixed value to info
|
||||
#########################################################################################
|
||||
def set_info_value(
|
||||
def set_disco_info_value(
|
||||
value: str = ""
|
||||
):
|
||||
"""
|
||||
|
@ -86,7 +100,7 @@ def set_info_value(
|
|||
####
|
||||
# Add data to info
|
||||
#########################################################################################
|
||||
def add_info_value(
|
||||
def add_disco_info_value(
|
||||
value: str = ""
|
||||
):
|
||||
"""
|
||||
|
@ -102,7 +116,7 @@ def add_info_value(
|
|||
####
|
||||
# Set fixed value to monitoring data
|
||||
#########################################################################################
|
||||
def set_monitoring_data(
|
||||
def set_disco_monitoring_data(
|
||||
data: list = []
|
||||
):
|
||||
"""
|
||||
|
@ -115,7 +129,7 @@ def set_monitoring_data(
|
|||
####
|
||||
# Add value to monitoring data
|
||||
#########################################################################################
|
||||
def add_monitoring_data(
|
||||
def add_disco_monitoring_data(
|
||||
data: dict = {}
|
||||
):
|
||||
"""
|
||||
|
@ -128,7 +142,7 @@ def add_monitoring_data(
|
|||
####
|
||||
# Print JSON output and exit script
|
||||
#########################################################################################
|
||||
def print_output():
|
||||
def disco_output():
|
||||
"""
|
||||
Prints the JSON output and exits the script.
|
||||
|
||||
|
|
|
@ -18,6 +18,20 @@ from binascii import unhexlify
|
|||
|
||||
_PASSWORD = "default_salt"
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Internal use only: Get AES cipher
|
||||
#########################################################################################
|
||||
|
|
|
@ -291,6 +291,20 @@ _ENT2CHR = {
|
|||
# Construct the character to entity mapping.
|
||||
_CHR2ENT = {v: "&" + k + ";" for k, v in _ENT2CHR.items()}
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Convert the input_string encoded in html entity to clear char string.
|
||||
#########################################################################################
|
||||
|
@ -367,8 +381,8 @@ def generate_md5(
|
|||
#########################################################################################
|
||||
|
||||
def now(
|
||||
print_flag: bool = False,
|
||||
utimestamp: bool = False
|
||||
utimestamp: bool = False,
|
||||
print_flag: bool = False
|
||||
) -> str:
|
||||
"""
|
||||
Returns time in yyyy/mm/dd HH:MM:SS format by default. Use 1 as an argument
|
||||
|
|
|
@ -3,6 +3,20 @@ from requests.auth import HTTPBasicAuth
|
|||
from requests.auth import HTTPDigestAuth
|
||||
from requests.sessions import Session
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Auth URL session
|
||||
#########################################################################################
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Init module template
|
||||
#########################################################################################
|
||||
|
|
|
@ -2,6 +2,19 @@ import sys
|
|||
import os
|
||||
import json
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Prints message in stdout
|
||||
#########################################################################################
|
||||
|
|
|
@ -11,6 +11,20 @@ _MANAGER = Manager()
|
|||
_SHARED_DICT = _MANAGER.dict()
|
||||
_SHARED_DICT_LOCK = _MANAGER.Lock()
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Internal use only: Run a given function in a thread
|
||||
#########################################################################################
|
||||
|
|
|
@ -20,6 +20,20 @@ GLOBAL_VARIABLES = {
|
|||
'tentacle_extra_opts' : ''
|
||||
}
|
||||
|
||||
####
|
||||
# Internal: Alias for output.print_debug function
|
||||
#########################################################################################
|
||||
|
||||
def _print_debug(
|
||||
var = "",
|
||||
print_errors: bool = False
|
||||
):
|
||||
"""
|
||||
Prints any list, dict, string, float or integer as a json
|
||||
"""
|
||||
from .output import print_debug
|
||||
print_debug(var, print_errors)
|
||||
|
||||
####
|
||||
# Set a global variable with the specified name and assigns a value to it.
|
||||
#########################################################################################
|
||||
|
|
Loading…
Reference in New Issue