diff --git a/.bin/Scripts/functions/ddrescue.py b/.bin/Scripts/functions/ddrescue.py index d7d7626c..79a58960 100644 --- a/.bin/Scripts/functions/ddrescue.py +++ b/.bin/Scripts/functions/ddrescue.py @@ -266,6 +266,7 @@ class RecoveryState(): self.etoc = '' self.settings = DDRESCUE_SETTINGS.copy() self.finished = False + self.ost = osTicket([], []) self.panes = {} self.progress_out = '{}/progress.out'.format(global_vars['LogDir']) self.rescued = 0 @@ -531,8 +532,20 @@ class RecoveryState(): map_dir = '{}/{}'.format(MAP_DIR, global_vars['Date-Time']) # Get Ticket ID - # TODO - # map_dir = '{}/{}_{}'.format(MAP_DIR, ticket_id, ticket_name) + self.ticket_id = None + self.ticket_name = None + if not self.ost.disabled: + try: + self.ticket_id, self.ticket_name = self.ost.get_ticket_details() + except TypeError: + # Happens if connection fails and retry is not attempted + pass + if self.ticket_id and self.ticket_name: + map_dir = '{}/{}_{}'.format( + MAP_DIR, + self.ticket_id, + self.ticket_name.replace(' ', '-'), + ) # Mount backup shares mount_backup_shares(read_write=True)