Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tom Niget
slapos
Commits
4423eb31
Commit
4423eb31
authored
Jan 31, 2023
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
0deb810a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+1
-1
software/ors-amarisoft/promise/check_vswr.py
software/ors-amarisoft/promise/check_vswr.py
+9
-13
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
4423eb31
...
@@ -124,4 +124,4 @@ md5sum = 44ae5693f62b7a4dbc98f700f68d8600
...
@@ -124,4 +124,4 @@ md5sum = 44ae5693f62b7a4dbc98f700f68d8600
[vswr-promise]
[vswr-promise]
_update_hash_filename_ = promise/check_vswr.py
_update_hash_filename_ = promise/check_vswr.py
md5sum =
9778f2da6777a11568b4e36f20ae8500
md5sum =
a639d6273413fe23ba97a8920fb1ac12
software/ors-amarisoft/promise/check_vswr.py
View file @
4423eb31
...
@@ -2,7 +2,6 @@ import errno
...
@@ -2,7 +2,6 @@ import errno
import
json
import
json
import
logging
import
logging
import
os
import
os
import
time
from
dateutil
import
parser
from
dateutil
import
parser
...
@@ -103,26 +102,23 @@ class RunPromise(GenericPromise):
...
@@ -103,26 +102,23 @@ class RunPromise(GenericPromise):
alarm_notifs
=
notifications
[
'alarm-notif'
]
alarm_notifs
=
notifications
[
'alarm-notif'
]
fault_texts
=
alarm_notifs
[
'fault-text'
]
fault_texts
=
alarm_notifs
[
'fault-text'
]
fault_sources
=
alarm_notifs
[
'fault-source'
]
fault_sources
=
alarm_notifs
[
'fault-source'
]
event_time
=
alarm_notifs
[
'event-time'
]
is_cleared
=
alarm_notifs
[
'is-cleared'
]
if
not
fault_text_list
:
if
not
fault_text_list
:
fault_text_list
=
[
"None"
,]
fault_text_list
=
[
"None"
,]
for
i
,
fault_text
in
enumerate
(
fault_texts
):
for
i
,
fault_text
in
enumerate
(
fault_texts
):
if
'VSWR'
in
fault_text
:
if
'VSWR'
in
fault_text
:
if
is_cleared
==
'false'
:
alarm
=
True
alarm
=
True
self
.
logger
.
error
(
fault_sources
+
": "
+
fault_texts
)
else
:
self
.
logger
.
info
(
fault_sources
+
": "
+
fault_texts
+
" is no longer over threshold"
)
if
not
fault_text
_list
:
if
not
data
_list
:
self
.
logger
.
error
(
"No notification available"
)
self
.
logger
.
error
(
"No notification available"
)
elif
alarm
:
elif
not
alarm
:
self
.
logger
.
error
(
fault_source
+
": "
+
fault_text
)
else
:
self
.
logger
.
info
(
"No VSWR alarm detected"
)
self
.
logger
.
info
(
"No VSWR alarm detected"
)
now
=
time
.
time
()
event_time_seconds
=
time
.
mktime
(
time
.
strptime
(
event_time
,
"%Y-%m-%dT%H:%M:%SZ"
))
if
now
-
event_time_seconds
>=
300
:
alarm
=
False
time
.
sleep
(
1
)
def
test
(
self
):
def
test
(
self
):
"""
"""
Called after sense() if the instance is still converging.
Called after sense() if the instance is still converging.
...
...
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