Skip to content

Commit

Permalink
Fehlerbehandlung Option Sicherung vor Update (#1611)
Browse files Browse the repository at this point in the history
* fix Fehlerbehandlung Option Sicherung vor System Update

* fix Fehlerbehandlung Option Sicherung vor System Update

* fix communication problem

* undo timeout increase 30 -> 120

* replaced time.sleep(1) with return

* fix whitespace
  • Loading branch information
pama87 authored May 13, 2024
1 parent a6d16f8 commit a4d0472
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions packages/helpermodules/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,22 +640,28 @@ def systemUpdate(self, connection_id: str, payload: dict) -> None:
except Exception:
pub_user_message(payload, connection_id,
("Fehler beim Erstellen der Cloud-Sicherung."
f" {traceback.format_exc()}<br />Fahre mit Update fort..."), MessageType.WARNING)
parent_file = Path(__file__).resolve().parents[2]
if "branch" in payload["data"] and "tag" in payload["data"]:
pub_user_message(
payload, connection_id,
f'Wechsel auf Zweig \'{payload["data"]["branch"]}\' Tag \'{payload["data"]["tag"]}\' gestartet.',
MessageType.SUCCESS)
subprocess.run([
str(parent_file / "runs" / "update_self.sh"),
str(payload["data"]["branch"]),
str(payload["data"]["tag"])])
else:
pub_user_message(payload, connection_id, "Update gestartet.", MessageType.INFO)
subprocess.run([
str(parent_file / "runs" / "update_self.sh"),
SubData.system_data["system"].data["current_branch"]])
f" {traceback.format_exc()}<br />Update abgebrochen!"
"Bitte Fehlerstatus überprüfen!. " +
"Option Sicherung vor System Update kann unter Datenverwaltung deaktiviert werden."),
MessageType.WARNING)
Pub().pub("openWB/system/update_in_progress", False)
return
if SubData.system_data["system"].data["update_in_progress"]:
parent_file = Path(__file__).resolve().parents[2]
if "branch" in payload["data"] and "tag" in payload["data"]:
pub_user_message(
payload, connection_id,
f'Wechsel auf Zweig \'{payload["data"]["branch"]}\' Tag \'{payload["data"]["tag"]}\' gestartet.',
MessageType.SUCCESS)
subprocess.run([
str(parent_file / "runs" / "update_self.sh"),
str(payload["data"]["branch"]),
str(payload["data"]["tag"])])
else:
pub_user_message(payload, connection_id, "Update gestartet.", MessageType.INFO)
subprocess.run([
str(parent_file / "runs" / "update_self.sh"),
SubData.system_data["system"].data["current_branch"]])

def systemFetchVersions(self, connection_id: str, payload: dict) -> None:
log.info("Fetch versions requested")
Expand Down

0 comments on commit a4d0472

Please sign in to comment.