Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
346357bb
Commit
346357bb
authored
Apr 11, 2019
by
Никита Ефремов
Committed by
Никита Ефремов
Apr 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added exception handler to common_info
parent
879cc3bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
fmod_common_info.py
plugins/functions/fmod_common_info.py
+12
-2
service_decorators.py
settingsd/service_decorators.py
+2
-0
No files found.
plugins/functions/fmod_common_info.py
View file @
346357bb
...
...
@@ -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
...
...
@@ -37,6 +38,8 @@ class CommonInfo(service.FunctionObject) :
@service.functionMethod
(
LSB_RELASE_METHODS_NAMESPACE
,
out_signature
=
"s"
)
def
version
(
self
)
:
import
pdb
pdb
.
set_trace
return
self
.
lsbOption
(
LSB_OPTION_VERSION
)
@service.functionMethod
(
LSB_RELASE_METHODS_NAMESPACE
,
out_signature
=
"s"
)
...
...
@@ -93,12 +96,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 #####
...
...
settingsd/service_decorators.py
View file @
346357bb
...
...
@@ -56,6 +56,8 @@ def customMethod(interface_name, **kwargs_dict) :
def
functionMethod
(
interface_name
,
**
kwargs_dict
)
:
def
decorator
(
function
)
:
import
pdb
pdb
.
set_trace
return
customMethod
(
tools
.
dbus
.
joinMethod
(
config
.
value
(
config
.
APPLICATION_SECTION
,
"service_name"
),
"functions"
,
interface_name
),
**
kwargs_dict
)(
function
)
return
decorator
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment