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
d9bc9c47
Commit
d9bc9c47
authored
Dec 03, 2010
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some calls of execProcess in plugins no longer cause exceptions
parent
c69a622f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
fmod_date_time.py
plugins/functions/fmod_date_time.py
+2
-2
fmod_machine.py
plugins/functions/fmod_machine.py
+5
-5
fmod_system_services.py
plugins/functions/fmod_system_services.py
+6
-3
No files found.
plugins/functions/fmod_date_time.py
View file @
d9bc9c47
...
@@ -33,7 +33,7 @@ class DateTime(service.FunctionObject) :
...
@@ -33,7 +33,7 @@ class DateTime(service.FunctionObject) :
def
setUtcTime
(
self
,
month
,
monthday
,
hour
,
minute
,
year
,
second
)
:
def
setUtcTime
(
self
,
month
,
monthday
,
hour
,
minute
,
year
,
second
)
:
proc_args
=
"
%
s -u
%02
d
%02
d
%02
d
%02
d
%04
d.
%02
d"
%
(
config
.
value
(
SERVICE_NAME
,
"date_prog_path"
),
proc_args
=
"
%
s -u
%02
d
%02
d
%02
d
%02
d
%04
d.
%02
d"
%
(
config
.
value
(
SERVICE_NAME
,
"date_prog_path"
),
month
,
monthday
,
hour
,
minute
,
year
,
second
)
month
,
monthday
,
hour
,
minute
,
year
,
second
)
return
tools
.
execProcess
(
proc_args
)[
2
]
return
tools
.
execProcess
(
proc_args
,
False
)[
2
]
@service.functionMethod
(
SYSTEM_CLOCK_METHODS_NAMESPACE
,
out_signature
=
"iiiiii"
)
@service.functionMethod
(
SYSTEM_CLOCK_METHODS_NAMESPACE
,
out_signature
=
"iiiiii"
)
def
utcTime
(
self
)
:
def
utcTime
(
self
)
:
...
@@ -108,7 +108,7 @@ class DateTime(service.FunctionObject) :
...
@@ -108,7 +108,7 @@ class DateTime(service.FunctionObject) :
@service.functionMethod
(
HARDWARE_CLOCK_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
HARDWARE_CLOCK_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
syncWithSystem
(
self
)
:
def
syncWithSystem
(
self
)
:
return
tools
.
execProcess
(
"
%
s --systohc"
%
(
config
.
value
(
SERVICE_NAME
,
"hwclock_prog_path"
)))[
0
]
return
tools
.
execProcess
(
"
%
s --systohc"
%
(
config
.
value
(
SERVICE_NAME
,
"hwclock_prog_path"
))
,
False
)[
0
]
##### Public classes #####
##### Public classes #####
...
...
plugins/functions/fmod_machine.py
View file @
d9bc9c47
...
@@ -25,26 +25,26 @@ class Machine(service.FunctionObject) :
...
@@ -25,26 +25,26 @@ class Machine(service.FunctionObject) :
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
shutdown
(
self
)
:
def
shutdown
(
self
)
:
return
tools
.
execProcess
(
"
%
s -h now"
%
(
config
.
value
(
SERVICE_NAME
,
"shutdown_prog_path"
)))[
2
]
return
tools
.
execProcess
(
"
%
s -h now"
%
(
config
.
value
(
SERVICE_NAME
,
"shutdown_prog_path"
))
,
False
)[
2
]
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
reboot
(
self
)
:
def
reboot
(
self
)
:
return
tools
.
execProcess
(
"
%
s -r now"
%
(
config
.
value
(
SERVICE_NAME
,
"shutdown_prog_path"
)))[
2
]
return
tools
.
execProcess
(
"
%
s -r now"
%
(
config
.
value
(
SERVICE_NAME
,
"shutdown_prog_path"
))
,
False
)[
2
]
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
suspend
(
self
)
:
def
suspend
(
self
)
:
return
tools
.
execProcess
(
config
.
value
(
SERVICE_NAME
,
"pm_suspend_prog_path"
))[
2
]
return
tools
.
execProcess
(
config
.
value
(
SERVICE_NAME
,
"pm_suspend_prog_path"
)
,
False
)[
2
]
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
POWER_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
hibernate
(
self
)
:
def
hibernate
(
self
)
:
return
tools
.
execProcess
(
config
.
value
(
SERVICE_NAME
,
"pm_hibernate_prog_path"
))[
2
]
return
tools
.
execProcess
(
config
.
value
(
SERVICE_NAME
,
"pm_hibernate_prog_path"
)
,
False
)[
2
]
###
###
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
in_signature
=
"i"
,
out_signature
=
"i"
)
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
in_signature
=
"i"
,
out_signature
=
"i"
)
def
switchTo
(
self
,
level
)
:
def
switchTo
(
self
,
level
)
:
proc_args
=
"
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"telinit_prog_path"
),
validators
.
validRange
(
str
(
level
),
RUNLEVELS
))
proc_args
=
"
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"telinit_prog_path"
),
validators
.
validRange
(
str
(
level
),
RUNLEVELS
))
return
tools
.
execProcess
(
proc_args
)[
2
]
return
tools
.
execProcess
(
proc_args
,
False
)[
2
]
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
currentLevel
(
self
)
:
def
currentLevel
(
self
)
:
...
...
plugins/functions/fmod_system_services.py
View file @
d9bc9c47
...
@@ -74,16 +74,19 @@ class SystemService(service.FunctionObject) :
...
@@ -74,16 +74,19 @@ class SystemService(service.FunctionObject) :
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
start
(
self
)
:
def
start
(
self
)
:
logger
.
verbose
(
"{mod}: Request to start service
\"
%
s
\"
"
%
(
self
.
__system_service_name
))
logger
.
verbose
(
"{mod}: Request to start service
\"
%
s
\"
"
%
(
self
.
__system_service_name
))
return
tools
.
execProcess
(
"
%
s start"
%
(
os
.
path
.
join
(
config
.
value
(
SERVICE_NAME
,
"initd_dir_path"
),
self
.
__system_service_name
)))[
2
]
return
tools
.
execProcess
(
"
%
s start"
%
(
os
.
path
.
join
(
config
.
value
(
SERVICE_NAME
,
"initd_dir_path"
),
self
.
__system_service_name
)
),
False
)[
2
]
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
stop
(
self
)
:
def
stop
(
self
)
:
logger
.
verbose
(
"{mod}: Request to stop service
\"
%
s
\"
"
%
(
self
.
__system_service_name
))
logger
.
verbose
(
"{mod}: Request to stop service
\"
%
s
\"
"
%
(
self
.
__system_service_name
))
return
tools
.
execProcess
(
"
%
s stop"
%
(
os
.
path
.
join
(
config
.
value
(
SERVICE_NAME
,
"initd_dir_path"
),
self
.
__system_service_name
)))[
2
]
return
tools
.
execProcess
(
"
%
s stop"
%
(
os
.
path
.
join
(
config
.
value
(
SERVICE_NAME
,
"initd_dir_path"
),
self
.
__system_service_name
)
),
False
)[
2
]
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
status
(
self
)
:
def
status
(
self
)
:
return
tools
.
execProcess
(
"
%
s status"
%
(
os
.
path
.
join
(
config
.
value
(
SERVICE_NAME
,
"initd_dir_path"
),
self
.
__system_service_name
)))[
2
]
return
tools
.
execProcess
(
"
%
s status"
%
(
os
.
path
.
join
(
config
.
value
(
SERVICE_NAME
,
"initd_dir_path"
),
self
.
__system_service_name
)
),
False
)[
2
]
### Private ###
### Private ###
...
...
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