From aae7c1d54320f40d459afcda387a1877f84232bc Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 20 Sep 2018 00:58:21 -0600 Subject: [PATCH] Allow diabling osTicket integration per run --- .bin/Scripts/functions/hw_diags.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 45cb8575..0653203b 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -142,11 +142,16 @@ def get_osticket_number(): """Get ticket number and confirm with name from osTicket DB.""" ticket_number = None if not ost_db['Cursor']: - # No DB access, just set it to 0 - return 0 + # No DB access, return None to disable integration + return None while ticket_number is None: print_standard(' ') - _input = input('Enter ticket number: ') + _input = input('Enter ticket number (or leave blank to disable): ') + if re.match(r'^\s*$', _input): + if ask('Disable osTicket integration for this run?'): + return None + else: + continue if not re.match(r'^([0-9]+)$', _input): continue _name = osticket_get_ticket_name(_input)