Commit 6569950a authored by Nick Yefremov's avatar Nick Yefremov

Added exception handler to common_info

parent 879cc3bf
......@@ -3,6 +3,7 @@
from settingsd import config
from settingsd import service
from settingsd import logger
from settingsd import shared
import settingsd.tools as tools
......@@ -93,12 +94,19 @@ class CommonInfo(service.FunctionObject) :
### Private ###
def lsbOption(self, option) :
proc_args_list = [config.value(SERVICE_NAME, "lsb_release_bin"), option]
return ":".join(tools.process.execProcess(proc_args_list)[0].split(":")[1:]).strip()
def unameOption(self, option) :
proc_args_list = [config.value(SERVICE_NAME, "uname_bin"), option]
return tools.process.execProcess(proc_args_list)[0].strip()
try:
proc_args_list = [config.value(SERVICE_NAME, "uname_bin"), option]
return tools.process.execProcess(proc_args_list)[0].strip()
except FileNotFoundError:
logger.error("Directory /usr/bin/lsb_release does not exist")
return "Error: /usr/bin/lsb_release doesn\'t exist"
##### Public classes #####
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment