From 1d1a3756baddd9ed8f74a18c67c459d693fcaf3f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 13 Feb 2023 18:17:39 +0100 Subject: [PATCH] appsv2: missing raw_msg=True for exceptions --- src/utils/resources.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/resources.py b/src/utils/resources.py index 030c73574..2d4a479de 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -302,7 +302,8 @@ class PermissionsResource(AppResource): and properties["main"]["url"] != "/" ): raise YunohostError( - "URL for the 'main' permission should be '/' for webapps (or undefined/None for non-webapps). Note that / refers to the install url of the app" + "URL for the 'main' permission should be '/' for webapps (or undefined/None for non-webapps). Note that / refers to the install url of the app", + raw_msg=True ) super().__init__({"permissions": properties}, *args, **kwargs) @@ -470,12 +471,12 @@ class SystemuserAppResource(AppResource): if check_output(f"getent passwd {self.app} &>/dev/null || true").strip(): os.system(f"deluser {self.app} >/dev/null") if check_output(f"getent passwd {self.app} &>/dev/null || true").strip(): - raise YunohostError(f"Failed to delete system user for {self.app}") + raise YunohostError(f"Failed to delete system user for {self.app}", raw_msg=True) if check_output(f"getent group {self.app} &>/dev/null || true").strip(): os.system(f"delgroup {self.app} >/dev/null") if check_output(f"getent group {self.app} &>/dev/null || true").strip(): - raise YunohostError(f"Failed to delete system user for {self.app}") + raise YunohostError(f"Failed to delete system user for {self.app}", raw_msg=True) # FIXME : better logging and error handling, add stdout/stderr from the deluser/delgroup commands... @@ -743,7 +744,8 @@ class AptDependenciesAppResource(AppResource): isinstance(values.get(k), str) for k in ["repo", "key", "packages"] ): raise YunohostError( - "In apt resource in the manifest: 'extras' repo should have the keys 'repo', 'key' and 'packages' defined and be strings" + "In apt resource in the manifest: 'extras' repo should have the keys 'repo', 'key' and 'packages' defined and be strings", + raw_msg=True ) super().__init__(properties, *args, **kwargs) @@ -860,7 +862,8 @@ class PortsResource(AppResource): if infos["fixed"]: if self._port_is_used(port_value): raise YunohostValidationError( - f"Port {port_value} is already used by another process or app." + f"Port {port_value} is already used by another process or app.", + raw_msg=True ) else: while self._port_is_used(port_value):