Commit e6fc87b4 authored by Dmitry Lukhtionov's avatar Dmitry Lukhtionov Committed by EKbfh
Browse files

Fix string comparation

parent 44a9b5fa
...@@ -213,7 +213,7 @@ class DeployHandler(BaseHandler): ...@@ -213,7 +213,7 @@ class DeployHandler(BaseHandler):
def on_data(self, data): def on_data(self, data):
def qlog(x): def qlog(x):
if x.endswith("\n"): if x.endswith(b"\n"):
return x[:-1] return x[:-1]
else: else:
return x return x
...@@ -222,7 +222,7 @@ class DeployHandler(BaseHandler): ...@@ -222,7 +222,7 @@ class DeployHandler(BaseHandler):
self.write(data) self.write(data)
self.flush() self.flush()
self.job_log.append_log(data) 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() g = match.groups()
self.recap[g[0]] = [int(x) for x in g[1:]] self.recap[g[0]] = [int(x) for x in g[1:]]
self.play_log += [data] self.play_log += [data]
...@@ -240,7 +240,7 @@ class DeployHandler(BaseHandler): ...@@ -240,7 +240,7 @@ class DeployHandler(BaseHandler):
with db.atomic(): with db.atomic():
self.job_log.complete_ts = datetime.datetime.now() self.job_log.complete_ts = datetime.datetime.now()
self.job_log.is_complete = True 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_ok, self.job_log.n_changed,
self.job_log.n_unreachable, self.job_log.n_failed) = recap self.job_log.n_unreachable, self.job_log.n_failed) = recap
self.job_log.save() self.job_log.save()
...@@ -296,9 +296,9 @@ class Environment(Model): ...@@ -296,9 +296,9 @@ class Environment(Model):
for n in need_cert: for n in need_cert:
conf = json.loads(n.config) conf = json.loads(n.config)
conf["cert"] = certificate[s]["cert"] conf["cert"] = str(certificate[s]["cert"])
conf["cert_key"] = certificate[s]["key"] conf["cert_key"] = str(certificate[s]["key"])
n.config = json.dumps(conf.decode("utf-8"), sort_keys=True) n.config = json.dumps(conf, sort_keys=True)
n.save() n.save()
@staticmethod @staticmethod
......
...@@ -41,7 +41,7 @@ class JobLog(Model): ...@@ -41,7 +41,7 @@ class JobLog(Model):
def append_log(self, data): def append_log(self, data):
with open(self.log_path, "a") as f: with open(self.log_path, "a") as f:
f.write(data) f.write(str(data))
def get_log(self): def get_log(self):
path = self.log_path 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