Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
tower
Commits
dc1bc8c9
Commit
dc1bc8c9
authored
Jun 25, 2020
by
EKbfh
🐼
Browse files
Merge branch 'fix_1' into 'master'
Fix string comparation See merge request
!61
parents
44a9b5fa
e6fc87b4
Pipeline
#24438
passed with stages
in 7 minutes and 52 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tower/api/deploy.py
View file @
dc1bc8c9
...
...
@@ -213,7 +213,7 @@ class DeployHandler(BaseHandler):
def
on_data
(
self
,
data
):
def
qlog
(
x
):
if
x
.
endswith
(
"
\n
"
):
if
x
.
endswith
(
b
"
\n
"
):
return
x
[:
-
1
]
else
:
return
x
...
...
@@ -222,7 +222,7 @@ class DeployHandler(BaseHandler):
self
.
write
(
data
)
self
.
flush
()
self
.
job_log
.
append_log
(
data
)
for
match
in
self
.
rx_recap
.
finditer
(
data
):
for
match
in
self
.
rx_recap
.
finditer
(
str
(
data
)
)
:
g
=
match
.
groups
()
self
.
recap
[
g
[
0
]]
=
[
int
(
x
)
for
x
in
g
[
1
:]]
self
.
play_log
+=
[
data
]
...
...
@@ -240,7 +240,7 @@ class DeployHandler(BaseHandler):
with
db
.
atomic
():
self
.
job_log
.
complete_ts
=
datetime
.
datetime
.
now
()
self
.
job_log
.
is_complete
=
True
self
.
job_log
.
log
=
""
.
join
(
self
.
play_log
)
self
.
job_log
.
log
=
""
.
join
(
str
(
self
.
play_log
)
)
(
self
.
job_log
.
n_ok
,
self
.
job_log
.
n_changed
,
self
.
job_log
.
n_unreachable
,
self
.
job_log
.
n_failed
)
=
recap
self
.
job_log
.
save
()
tower/models/environment.py
View file @
dc1bc8c9
...
...
@@ -296,9 +296,9 @@ class Environment(Model):
for
n
in
need_cert
:
conf
=
json
.
loads
(
n
.
config
)
conf
[
"cert"
]
=
certificate
[
s
][
"cert"
]
conf
[
"cert_key"
]
=
certificate
[
s
][
"key"
]
n
.
config
=
json
.
dumps
(
conf
.
decode
(
"utf-8"
)
,
sort_keys
=
True
)
conf
[
"cert"
]
=
str
(
certificate
[
s
][
"cert"
]
)
conf
[
"cert_key"
]
=
str
(
certificate
[
s
][
"key"
]
)
n
.
config
=
json
.
dumps
(
conf
,
sort_keys
=
True
)
n
.
save
()
@
staticmethod
...
...
tower/models/joblog.py
View file @
dc1bc8c9
...
...
@@ -41,7 +41,7 @@ class JobLog(Model):
def
append_log
(
self
,
data
):
with
open
(
self
.
log_path
,
"a"
)
as
f
:
f
.
write
(
data
)
f
.
write
(
str
(
data
)
)
def
get_log
(
self
):
path
=
self
.
log_path
...
...
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