This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def csvbackup(REGEX, FOLDER): | |
""" Find any file with the REGEX pattern in the PWD | |
and send it to assigned FOLDER. | |
""" | |
try: | |
current = os.getcwd() | |
files = glob.iglob(os.path.join(current, REGEX)) | |
DST_FLD = current + '/' + FOLDER | |
for bkup in files: | |
if os.path.isfile(bkup): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_vrfcli(task, servicename): | |
''' Retrieve VRF from IOSXR | |
''' | |
vrf = task.run(netmiko_send_command, command_string=f"sh vrf {servicename} detail") | |
print_result(vrf) | |
def get_vprncli(task, servicename): | |
''' Retrieve VPRN from Nokia | |
''' | |
vprn = task.run(netmiko_send_command, command_string=f"show service id {servicename} base") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def simple_excel(workbook, sheetname, keep_vba=False, data_only=True): | |
wb_obj = load_workbook( | |
filename=workbook, keep_vba=keep_vba, data_only=data_only, read_only=True | |
) | |
wsheet = wb_obj[sheetname] | |
data_key = [] | |
for value in wsheet.iter_rows(values_only=True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############# | |
# Dependencies | |
# This base stage just installs the dependencies required for production | |
# without any development deps. | |
ARG PYTHON_VER=3.8 | |
FROM python:${PYTHON_VER} AS base | |
WORKDIR /usr/src/app |
OlderNewer