Skip to content

Commit 7251d74

Browse files
committed
[18.0][FIX] server_environment lsb_release unavailable
1 parent a8f8888 commit 7251d74

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

server_environment/system_info.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
44

55
import locale
6+
import logging
67
import os
78
import platform
89
import subprocess
@@ -11,6 +12,8 @@
1112
from odoo import release
1213
from odoo.tools.config import config
1314

15+
_logger = logging.getLogger(__name__)
16+
1417

1518
def _get_output(cmd):
1619
bindir = config["root_path"]
@@ -34,10 +37,12 @@ def get_server_environment():
3437
os_lang = ".".join([x for x in locale.getlocale() if x])
3538
if not os_lang:
3639
os_lang = "NOT SET"
40+
lsbinfo = "not lsb compliant"
3741
if os.name == "posix" and platform.system() == "Linux":
38-
lsbinfo = _get_output("lsb_release -a")
39-
else:
40-
lsbinfo = "not lsb compliant"
42+
try:
43+
lsbinfo = _get_output("lsb_release -a")
44+
except Exception:
45+
_logger.info("lsb_release not compliant")
4146
return (
4247
("platform", platform.platform()),
4348
("os.name", os.name),

0 commit comments

Comments
 (0)