Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
ws-timeseries
Commits
5b20727b
Commit
5b20727b
authored
Sep 04, 2020
by
Jerome Touvier
Browse files
fix error message
parent
d2559da1
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
5b20727b
...
...
@@ -15,6 +15,7 @@ build:
IMAGE_NAME
:
$CI_REGISTRY_IMAGE/ws-timeseries:$CI_COMMIT_SHORT_SHA
script
:
-
$REGISTRY_LOGIN $CI_REGISTRY
-
echo $CI_COMMIT_SHORT_SHA > ./static/commit.txt
-
$IMAGE_BUILD --file $DOCKERFILE $BUILD_ARG --tag $IMAGE_NAME .
-
$IMAGE_PUSH $IMAGE_NAME $IMAGE_NAME
-
$REGISTRY_LOGOUT $CI_REGISTRY
...
...
apps/utils.py
View file @
5b20727b
...
...
@@ -155,13 +155,14 @@ def error_request(msg="", details="", code=500):
message_error
=
f
"""Error
{
code
}
:
{
msg
}
\n
{
details
}
\n
Request:
{
request
.
url
}
\n
{
request
.
full_path
}
\n
Request Submitted:
{
request_date
}
\n
Service version:
version:
{
VERSION
}
"""
return
Response
(
message_error
,
status
=
code
,
mimetype
=
"text/plain"
)
# No data response alias
def
error_nodata
(
params
,
dmesg
=
Error
.
NODATA
):
code
=
int
(
params
[
"nodata"
])
...
...
start_timeseries.py
View file @
5b20727b
...
...
@@ -43,6 +43,18 @@ def version():
return
response
@
app
.
route
(
"/commit"
,
strict_slashes
=
False
)
def
commit
():
try
:
with
open
(
"./static/commit.txt"
)
as
commit_file
:
COMMIT_SHORT_SHA
=
commit_file
.
readline
()
except
Exception
:
COMMIT_SHORT_SHA
=
"unspecified"
response
=
make_response
(
COMMIT_SHORT_SHA
)
response
.
headers
[
"Content-Type"
]
=
"text/plain"
return
response
@
app
.
route
(
"/"
)
@
app
.
route
(
"/local=fr"
)
def
doc
():
...
...
start_timeseriesplot.py
View file @
5b20727b
...
...
@@ -43,6 +43,18 @@ def version():
return
response
@
app
.
route
(
"/commit"
,
strict_slashes
=
False
)
def
commit
():
try
:
with
open
(
"./static/commit.txt"
)
as
commit_file
:
COMMIT_SHORT_SHA
=
commit_file
.
readline
()
except
Exception
:
COMMIT_SHORT_SHA
=
"unspecified"
response
=
make_response
(
COMMIT_SHORT_SHA
)
response
.
headers
[
"Content-Type"
]
=
"text/plain"
return
response
@
app
.
route
(
"/"
)
@
app
.
route
(
"/local=fr"
)
def
doc
():
...
...
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