From 4e1ed0e45f1833abd777017ddebb73e06c12994b Mon Sep 17 00:00:00 2001 From: Haas Date: Sun, 19 Apr 2020 17:52:03 -0400 Subject: [PATCH] #minor add SIP trunk export and remove custom img dir for pyinstaller to work --- cucm-exporter.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cucm-exporter.py b/cucm-exporter.py index 741e1d6..b70279a 100644 --- a/cucm-exporter.py +++ b/cucm-exporter.py @@ -1,4 +1,5 @@ import csv, json, sys +from pathlib import Path from datetime import datetime from ciscoaxl import axl from ciscoris import ris @@ -7,6 +8,9 @@ from gooey import Gooey, GooeyParser import cucm +BASE_DIR = Path(__file__).resolve().parent +IMG_DIR = BASE_DIR.joinpath("img") + start_time = datetime.now() print(f"status: starting {start_time}") @@ -63,7 +67,7 @@ def write_csv(filename, results, content): ], }, ], - image_dir="img", + # image_dir=IMG_DIR, tabbed_groups=True, ) def main(): @@ -213,6 +217,13 @@ def main(): else: print(f"status: no {cli_args.cucm_export} found...") print(f"status: elapsed time -- {datetime.now() - start_time}\n") + elif cli_args.cucm_export == "sip-trunks": + output = cucm.export_siptrunks(ucm_axl) + if len(output) > 0: + write_csv(filename=filename, results=cli_args, content=output) + else: + print(f"status: no {cli_args.cucm_export} found...") + print(f"status: elapsed time -- {datetime.now() - start_time}\n") else: print(f"exporting {cli_args.cucm_export} is not yet supported") return