Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Sep 13, 2024
1 parent 4589663 commit edcbbfc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/controllers/App/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def is_json(self, jsonString):
#
#-----------------------------------------------------------------------------------------------
def remove_ansi(self, text):
ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]')

return ansi_escape.sub('', text)
try:
ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]')
return ansi_escape.sub('', text)
# If an exception occurs, simply return the original text as it is
except Exception as e:
return text
2 changes: 1 addition & 1 deletion src/controllers/Module/Reposerver/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def websocket_on_message(self, ws, message):
Path(log).unlink()
except Exception as e:
# If content could not be read, then generate an error message
logcontent = 'Error: could not read log file'
logcontent = 'Error: could not read log file: ' + str(e)

json_response['response-to-request']['log'] = logcontent

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/Package/Apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def update(self, packagesList, update_method: str = 'one_by_one', exit_on_packag
cmd = [
'apt-get', 'install', pkg['name'], '-y',
# Debug only
# '--dry-run',
'--dry-run',
'-o', 'Dpkg::Options::=--force-confdef',
'-o', 'Dpkg::Options::=--force-confold'
]
Expand Down

0 comments on commit edcbbfc

Please sign in to comment.