Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
FofbTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DG
FOFB
FofbTool
Commits
0496ddce
Commit
0496ddce
authored
5 months ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
Fix function return
* Return True on success * Decorator forward the return
parent
fca988c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FofbTool/Configuration.py
+1
-1
1 addition, 1 deletion
FofbTool/Configuration.py
FofbTool/Operation.py
+19
-2
19 additions, 2 deletions
FofbTool/Operation.py
with
20 additions
and
3 deletions
FofbTool/Configuration.py
+
1
−
1
View file @
0496ddce
...
...
@@ -18,7 +18,7 @@ logger = logging.getLogger("FofbTool")
def
trycatch_tango_devfailed
(
func
):
def
inner_function
(
*
args
,
**
kwargs
):
try
:
func
(
*
args
,
**
kwargs
)
return
func
(
*
args
,
**
kwargs
)
except
tango
.
DevFailed
as
e
:
logger
.
error
(
"
DevFailed met during configuration
"
)
logger
.
debug
(
e
)
...
...
This diff is collapsed.
Click to expand it.
FofbTool/Operation.py
+
19
−
2
View file @
0496ddce
...
...
@@ -19,7 +19,7 @@ logger = logging.getLogger("FofbTool")
def
trycatch_tango_devfailed
(
func
):
def
inner_function
(
*
args
,
**
kwargs
):
try
:
func
(
*
args
,
**
kwargs
)
return
func
(
*
args
,
**
kwargs
)
except
tango
.
DevFailed
as
e
:
logger
.
error
(
"
DevFailed met during operation
"
)
logger
.
debug
(
e
)
...
...
@@ -155,6 +155,8 @@ def stop_ccn(node_tangopath, ccnif=[]):
prx
[
"
ccnpack{}_control
"
.
format
(
n
)]
=
False
prx
[
"
ccnunpack{}_control
"
.
format
(
n
)]
=
False
return
True
@trycatch_tango_devfailed
def
reset_ccn
(
node_tangopath
,
ccnif
=
[]):
"""
...
...
@@ -196,6 +198,8 @@ def reset_ccn(node_tangopath, ccnif=[]):
ack_ccn
(
node_tangopath
,
ccnif
)
return
True
@trycatch_tango_devfailed
def
start_ccn
(
node_tangopath
,
ccnif
=
[]):
"""
...
...
@@ -235,6 +239,8 @@ def start_ccn(node_tangopath, ccnif=[]):
prx
[
"
ccnpack{}_control
"
.
format
(
n
)]
=
1
prx
[
"
ccnunpack{}_control
"
.
format
(
n
)]
=
1
return
True
@trycatch_tango_devfailed
def
ack_ccn
(
node_tangopath
,
ccnif
=
[]):
"""
...
...
@@ -273,6 +279,8 @@ def ack_ccn(node_tangopath, ccnif=[]):
prx
[
"
ccnpack{}_reset_error
"
.
format
(
n
)]
=
False
prx
[
"
ccnunpack{}_reset_error
"
.
format
(
n
)]
=
False
return
True
###################################################################################################
# OPERATIONS ON COMBPM
###################################################################################################
...
...
@@ -302,6 +310,8 @@ def stop_combpm(node_tangopath):
prx
[
"
combpm_reset
"
]
=
1
prx
[
"
combpm_gt_control
"
]
=
0x5
return
True
@trycatch_tango_devfailed
def
start_combpm
(
node_tangopath
):
"""
...
...
@@ -321,7 +331,7 @@ def start_combpm(node_tangopath):
prx
.
ping
()
except
tango
.
DevFailed
:
logger
.
error
(
"
Failed to obtain tango proxy or to ping to {}
"
.
format
(
node_tangopath
))
return
Non
e
return
Fals
e
logger
.
info
(
"
Starting ComBpm on {}
"
.
format
(
node_tangopath
))
prx
[
"
combpm_reset
"
]
=
0
...
...
@@ -329,6 +339,7 @@ def start_combpm(node_tangopath):
time
.
sleep
(
1
)
ack_combpm
(
node_tangopath
)
return
True
@trycatch_tango_devfailed
def
ack_combpm
(
node_tangopath
):
...
...
@@ -356,6 +367,7 @@ def ack_combpm(node_tangopath):
time
.
sleep
(
1
)
prx
[
"
combpm_reset_error
"
]
=
False
return
True
###################################################################################################
# OPERATIONS ON COMLBP
...
...
@@ -389,6 +401,8 @@ def stop_comlbp(node_tangopath):
for
n
in
range
(
4
):
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0
return
True
@trycatch_tango_devfailed
def
start_comlbp
(
node_tangopath
):
"""
...
...
@@ -414,6 +428,8 @@ def start_comlbp(node_tangopath):
for
n
in
range
(
4
):
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0x10
return
True
@trycatch_tango_devfailed
def
reset_comlbp
(
node_tangopath
):
...
...
@@ -444,6 +460,7 @@ def reset_comlbp(node_tangopath):
for
n
in
range
(
4
):
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0x0
return
True
###################################################################################################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment