Commit dc1bc8c9 authored by EKbfh's avatar 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
......@@ -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()
......@@ -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
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment