Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 22nd September 2020 starting at approximately 9am MST.It is expected to take around 15 minutes and there will be a short period of downtime towards the end of the maintenance window. Please address any comments, questions, or concerns to computing-help@igwn.org.

Adding hack to createVOEvent for file text

Adding same hack as in voevents() to return the VOEvent file text.
This is temporary and will be removed in a future release.
parent a669a741
......@@ -1619,7 +1619,7 @@ class GraceDb(GsiRest):
skymap_filename=None, skymap_image_filename=None, internal=True,
vetted=False, open_alert=False, hardware_inj=False,
CoincComment=False, ProbHasNS=None, ProbHasRemnant=None,
*args, **kwargs):
get_voevent_file_text=True, *args, **kwargs):
# TBD for superevents - requires a lot of changes to server code
"""Create a new VOEvent
......@@ -1696,7 +1696,30 @@ class GraceDb(GsiRest):
if ProbHasRemnant:
body['ProbHasRemnant'] = ProbHasRemnant
return self.post(uri, body=body)
response = self.post(uri, body=body)
# Temporary hack to get voevent file text and include it in a
# response-like object for user consumption. Will be removed in a
# future release.
if get_voevent_file_text:
# print a deprecation warning
print("WARNING: the VOEvent file text will not be included in the "
"response JSON in a future release. Users can still get the "
"content of this file by using the files() method along with "
"the filename which is included in the response JSON. You may "
"call this method with the keyword argument "
"get_voevent_file_text=False if you do not need the file "
"content and would like to remove this warning message.")
# Get actual response JSON
r_json = response.json()
# Get file and add text
file_text = self.files(object_id, r_json['filename']).read()
r_json[u'text'] = file_text.decode()
response = FakeResponse(r_json)
return response
#-----------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment