Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pavel Kuzin
tower
Commits
e1a97081
Commit
e1a97081
authored
Jul 19, 2017
by
Aleksey Shirokih
Browse files
migrate session_ttl to be compatible with noc feature/config
parent
152643fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
tower/migrations/024_change_session_timeout.py
0 → 100644
View file @
e1a97081
# Third-party modules
import
yaml
# Tower modules
from
tower.models.environment
import
Environment
def
migrate
(
migrator
):
for
env
in
Environment
.
select
():
config
=
yaml
.
load
(
env
.
service_config
)
if
"session_ttl"
in
config
[
None
][
"login"
]:
if
"d"
not
in
str
(
config
[
None
][
"login"
][
"session_ttl"
]):
config
[
None
][
"login"
][
"session_ttl"
]
=
str
(
config
[
None
][
"login"
][
"session_ttl"
])
+
"d"
env
.
service_config
=
yaml
.
dump
(
config
)
env
.
save
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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