Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cmsos
worksuite
Commits
48bbe9bd
Commit
48bbe9bd
authored
Oct 27, 2020
by
Dainius Simelevicius
Browse files
references #187: made hotspotmailer.py more robust
parent
9f677d1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
sentinel/utils/include/sentinel/utils/version.h
View file @
48bbe9bd
...
...
@@ -17,11 +17,11 @@
// !!! Edit this line to reflect the latest package version !!!
#define WORKSUITE_SENTINELUTILS_VERSION_MAJOR 2
#define WORKSUITE_SENTINELUTILS_VERSION_MINOR
3
#define WORKSUITE_SENTINELUTILS_VERSION_MINOR
4
#define WORKSUITE_SENTINELUTILS_VERSION_PATCH 0
// If any previous versions available E.g. #define WORKSUITE_SENTINELUTILS_PREVIOUS_VERSIONS "3.8.0,3.8.1"
#undef WORKSUITE_SENTINELUTILS_PREVIOUS_VERSIONS
#define WORKSUITE_SENTINELUTILS_PREVIOUS_VERSIONS "2.2.0"
#define WORKSUITE_SENTINELUTILS_PREVIOUS_VERSIONS "2.2.0
,2.3.0
"
//
...
...
sentinel/utils/scripts/hotspotmailer.py
View file @
48bbe9bd
...
...
@@ -44,16 +44,22 @@ zone = sys.argv[2]
print
(
"spotlightUrl = "
+
sys
.
argv
[
1
])
print
connection
=
http
.
client
.
HTTPConnection
(
spotlightUrl
)
#connection.set_debuglevel(1)
connection
.
request
(
'GET'
,
'/urn:xdaq-application:service=sentinelspotlight2g/lastStoredEvents'
)
response
=
connection
.
getresponse
()
result
=
response
.
read
().
decode
()
if
(
response
.
status
!=
200
):
print
(
"response.status = "
+
response
.
status
,
"response.reason = "
+
response
.
reason
)
exit
()
connection
.
close
()
succeded
=
False
while
not
succeded
:
try
:
connection
=
http
.
client
.
HTTPConnection
(
spotlightUrl
)
connection
.
request
(
'GET'
,
'/urn:xdaq-application:service=sentinelspotlight2g/lastStoredEvents'
)
response
=
connection
.
getresponse
()
result
=
response
.
read
().
decode
()
if
(
response
.
status
!=
200
):
print
(
"response.status = "
+
response
.
status
,
"response.reason = "
+
response
.
reason
)
exit
()
connection
.
close
()
succeded
=
True
except
:
connection
.
close
()
time
.
sleep
(
10
)
print
(
"Server is down retrying..."
)
events
=
json
.
loads
(
result
)
lastStoreTime
=
events
[
"lastStoreTime"
]
...
...
@@ -65,14 +71,22 @@ egroup_address = "cms-os-forward-" + zone + "@cern.ch"
severity_icons
=
{
"fatal"
:
"🟥"
,
"error"
:
"🟧"
,
"warning"
:
"🟨"
}
while
1
:
connection
.
request
(
'GET'
,
'/urn:xdaq-application:service=sentinelspotlight2g/lastStoredEvents?start='
+
lastStoreTime
)
response
=
connection
.
getresponse
()
result
=
response
.
read
().
decode
()
if
(
response
.
status
!=
200
):
print
(
"response.status = "
+
response
.
status
,
"response.reason = "
+
response
.
reason
)
exit
()
connection
.
close
()
succeded
=
False
while
not
succeded
:
try
:
connection
.
request
(
'GET'
,
'/urn:xdaq-application:service=sentinelspotlight2g/lastStoredEvents?start='
+
lastStoreTime
)
response
=
connection
.
getresponse
()
result
=
response
.
read
().
decode
()
if
(
response
.
status
!=
200
):
print
(
"response.status = "
+
response
.
status
,
"response.reason = "
+
response
.
reason
)
exit
()
connection
.
close
()
succeded
=
True
except
:
connection
.
close
()
time
.
sleep
(
10
)
print
(
"Server is down retrying..."
)
events
=
json
.
loads
(
result
)
lastStoreTime
=
events
[
"lastStoreTime"
]
print
(
"lastStoreTime = '"
+
lastStoreTime
+
"'"
)
...
...
Write
Preview
Supports
Markdown
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