1
0

assert datadir available

This commit is contained in:
SomberNight
2018-04-29 18:25:10 +02:00
parent cbf1b5d9d5
commit c8bed8791a
4 changed files with 42 additions and 14 deletions

View File

@@ -172,6 +172,7 @@ class TcpConnection(threading.Thread, util.PrintError):
# workaround android bug
cert = re.sub("([^\n])-----END CERTIFICATE-----","\\1\n-----END CERTIFICATE-----",cert)
temporary_path = cert_path + '.temp'
util.assert_datadir_available(self.config_path)
with open(temporary_path, "w", encoding='utf-8') as f:
f.write(cert)
f.flush()
@@ -201,6 +202,7 @@ class TcpConnection(threading.Thread, util.PrintError):
os.unlink(rej)
os.rename(temporary_path, rej)
else:
util.assert_datadir_available(self.config_path)
with open(cert_path, encoding='utf-8') as f:
cert = f.read()
try: