Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
980328a1
Commit
980328a1
authored
7 years ago
by
Tanner Prestegard
Committed by
gracedb-dev1
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixing failover to lvalert_send
parent
28536b38
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/alert.py
+8
-18
8 additions, 18 deletions
gracedb/alert.py
with
8 additions
and
18 deletions
gracedb/alert.py
+
8
−
18
View file @
980328a1
import
os
import
sys
from
subprocess
import
Popen
,
PIPE
,
STDOUT
...
...
@@ -303,16 +304,6 @@ def issueXMPPAlert(event, location, alert_type="new", description="", serialized
log
.
debug
(
'
issueXMPPAlert: %s
'
%
event
.
graceid
())
# XXX We no longer check the XMPP_ALERT_CHANNELS list.
# If somebody sends an event, there should always be an alert.
# It is up to the end users to filter these out as desired.
#
# if nodename not in settings.XMPP_ALERT_CHANNELS:
# log.debug("issueXMPPAlert: did not send alert")
# return
env
=
{}
env
[
"
PYTHONPATH
"
]
=
"
:
"
.
join
(
sys
.
path
)
# Create the output dictionary and serialize as JSON.
lva_data
=
{
'
file
'
:
location
,
...
...
@@ -355,27 +346,26 @@ def issueXMPPAlert(event, location, alert_type="new", description="", serialized
# Not using LVAlert overseer, so just log the node and server
log
.
info
(
"
issueXMPPAlert: sending to node %s on %s
"
%
(
nodename
,
server
))
null
=
open
(
'
/dev/null
'
,
'
w
'
)
# Set up environment for running lvalert_send script
env
=
os
.
environ
.
copy
()
# Construct lvalert_send command
p
=
Popen
(
[
"
lvalert_send
"
,
#"--server=%s" % settings.ALERT_XMPP_SERVER,
"
--server=%s
"
%
server
,
"
--username=gracedb
"
,
"
--password=w4k3upal1ve
"
,
"
--file=-
"
,
"
--node=%s
"
%
nodename
,
],
#executable="/usr/bin/lvalert_send",
executable
=
settings
.
LVALERT_SEND_EXECUTABLE
,
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
PIPE
,
env
=
env
)
# Send lvalert message to subprocess
out
,
err
=
p
.
communicate
(
msg
)
log
.
debug
(
"
issueXMPPAlert: return code %s
"
%
p
.
returncode
)
log
.
debug
(
"
issueXMPPAlert:
lvalert_send:
return code %s
"
%
p
.
returncode
)
if
p
.
returncode
>
0
:
# XXX This should probably raise an exception.
log
.
debug
(
"
issueXMPPAlert: ERROR: %s
"
%
err
)
log
.
error
(
"
issueXMPPAlert: ERROR: %s
"
%
err
)
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