Close PostgreSQL gate pipes cleanly after a nonblocking refusal
This commit is contained in:
+3
-5
@@ -140,12 +140,10 @@ class Renewal:
|
||||
return True
|
||||
finally:
|
||||
try:
|
||||
gate.stdin.write('ROLLBACK;\n\\q\n')
|
||||
gate.stdin.flush()
|
||||
gate.communicate(timeout=5)
|
||||
except (BrokenPipeError, subprocess.TimeoutExpired):
|
||||
gate.communicate('ROLLBACK;\n\\q\n', timeout=5)
|
||||
except subprocess.TimeoutExpired:
|
||||
gate.kill()
|
||||
gate.wait()
|
||||
gate.communicate()
|
||||
|
||||
def get_vm(self, vmid):
|
||||
return json.loads(run(['pvesh', 'get', f"/nodes/{self.binding['node']}/qemu/{vmid}/config", '--output-format', 'json']))
|
||||
|
||||
Reference in New Issue
Block a user