Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Release Engineering
Public
distrobuild
Commits
68f5f61f
Commit
68f5f61f
authored
Apr 11, 2021
by
Mustafa Gezen
🏗
Browse files
Use correct log dir when retrieving logs
parent
ef19c9f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
distrobuild/routes/imports.py
View file @
68f5f61f
...
...
@@ -29,6 +29,7 @@ from starlette.responses import PlainTextResponse
from
distrobuild.common
import
gen_body_filters
,
create_import_order
,
get_user
from
distrobuild.models
import
Import
,
Package
,
Repo
,
ImportStatus
from
distrobuild.serialize
import
Import_Pydantic
,
ImportGeneral_Pydantic
from
distrobuild.settings
import
settings
from
distrobuild_scheduler
import
import_package_task
router
=
APIRouter
(
prefix
=
"/imports"
)
...
...
@@ -63,7 +64,7 @@ async def get_import_logs(import_id: int):
if
not
import_obj
:
raise
HTTPException
(
404
,
detail
=
"import does not exist"
)
try
:
with
open
(
f
"
/tmp
/import-
{
import_obj
.
id
}
.log"
)
as
f
:
with
open
(
f
"
{
settings
.
import_logs_dir
}
/import-
{
import_obj
.
id
}
.log"
)
as
f
:
return
f
.
read
()
except
FileNotFoundError
:
raise
HTTPException
(
412
,
detail
=
"import not started or log has expired"
)
...
...
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