diff --git a/.bin/Scripts/functions/osticket.py b/.bin/Scripts/functions/osticket.py index bbf78353..3a1d20d7 100644 --- a/.bin/Scripts/functions/osticket.py +++ b/.bin/Scripts/functions/osticket.py @@ -30,7 +30,7 @@ class osTicket(): self.tests_disk = tests_disk self.tunnel_proc = None - def connect(self): + def connect(self, silent=True): """Establish connection to osTicket via a SSH tunnel.""" cmd = [ 'ssh', '-N', @@ -74,6 +74,11 @@ class osTicket(): if self.db_cursor is None: self.disabled = True self.tunnel_proc.kill() + if not silent: + print_warning('Failed to connect to osTicket') + print_standard('Integration disabled for this session') + print_standard(' ') + pause() def convert_report(self, name, test): """Convert report into an osTicket friendly format, returns list.""" @@ -354,7 +359,7 @@ class osTicket(): def get_ticket_number(self): """Get ticket number and confirm with name from osTicket DB.""" ticket_number = None - self.connect() + self.connect(silent=False) # Bail if disabled if self.disabled: @@ -369,6 +374,7 @@ class osTicket(): # No ticket ID entered if re.match(r'^\s*$', _input): if ask('Disable osTicket integration for this run?'): + self.disabled = True break # Invalid ID entered