Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
bfef57dd
Commit
bfef57dd
authored
Nov 23, 2018
by
Guilhem Saurel
Browse files
update: fix logger
parent
558d07db
Pipeline
#1895
failed with stages
in 1 minute and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/management/commands/update.py
View file @
bfef57dd
import
logging
from
django.conf
import
settings
from
django.core.management
import
call_command
from
django.core.management.base
import
BaseCommand
...
...
@@ -8,34 +6,36 @@ from django.db.models import F, Q
from
rainboard.models
import
Branch
,
Project
,
Repo
,
Robotpkg
from
rainboard.utils
import
update_robotpkg
logger
=
logging
.
getLogger
(
'rainboard.management.update'
)
class
Command
(
BaseCommand
):
help
=
'Update the DB'
def
handle
(
self
,
*
args
,
**
options
):
logger
.
info
(
f
'
\n
Updating all repos
\n
'
)
def
log
(
message
):
if
int
(
options
[
'verbosity'
])
>
1
:
self
.
stdout
.
write
(
message
)
log
(
f
'
\n
Updating all repos
\n
'
)
for
repo
in
Repo
.
objects
.
all
():
log
ger
.
info
(
f
'
{
repo
}
'
)
log
(
f
'
{
repo
}
'
)
repo
.
update
()
log
ger
.
info
(
f
'
\n
Updating all branches
\n
'
)
log
(
f
'
\n
Updating all branches
\n
'
)
for
branch
in
Branch
.
objects
.
all
():
log
ger
.
info
(
f
'
{
branch
}
'
)
log
(
f
'
{
branch
}
'
)
branch
.
update
(
pull
=
False
)
log
ger
.
info
(
f
'
\n
Pulling Robotpkg
\n
'
)
log
(
f
'
\n
Pulling Robotpkg
\n
'
)
update_robotpkg
(
settings
.
RAINBOARD_RPKG
)
log
ger
.
info
(
f
'
\n
Updating Robotpkg
\n
'
)
log
(
f
'
\n
Updating Robotpkg
\n
'
)
for
robotpkg
in
Robotpkg
.
objects
.
all
():
log
ger
.
info
(
f
'
{
robotpkg
}
'
)
log
(
f
'
{
robotpkg
}
'
)
robotpkg
.
update
(
pull
=
False
)
log
ger
.
info
(
f
'
\n
Updating all projects
\n
'
)
log
(
f
'
\n
Updating all projects
\n
'
)
for
project
in
Project
.
objects
.
all
():
log
ger
.
info
(
f
'
{
project
}
'
)
log
(
f
'
{
project
}
'
)
project
.
update
()
Branch
.
objects
.
filter
(
...
...
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