From 06b2834a289ed311b5719f2dcc52fc2be2c8809d Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 6 Oct 2022 14:17:57 +0500 Subject: [PATCH] bug fix: use different lscpd versions according to os detection --- install/install.py | 5 +++-- plogical/upgrade.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/install/install.py b/install/install.py index 9fde99c22..badb27359 100755 --- a/install/install.py +++ b/install/install.py @@ -1459,8 +1459,9 @@ autocreate_system_folders = On result = open('/etc/lsb-release', 'r').read() lscpdSelection = 'lscpd-0.3.1' - if result.find('22.04') > -1: - lscpdSelection = 'lscpd.0.4.0' + if os.path.exists('/etc/lsb-release'): + if result.find('22.04') > -1: + lscpdSelection = 'lscpd.0.4.0' command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}' diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 109c81ee9..cdf46bad8 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1995,8 +1995,9 @@ autocreate_system_folders = On result = open(Upgrade.UbuntuPath, 'r').read() lscpdSelection = 'lscpd-0.3.1' - if result.find('22.04') > -1: - lscpdSelection = 'lscpd.0.4.0' + if os.path.exists(Upgrade.UbuntuPath): + if result.find('22.04') > -1: + lscpdSelection = 'lscpd.0.4.0' command = f'cp -f /usr/local/CyberCP/{lscpdSelection} /usr/local/lscp/bin/{lscpdSelection}' Upgrade.executioner(command, command, 0)