entrypoint.py: ensure parent directories exist

Create the parent directores for the socket if they don't exist.
This commit is contained in:
Christian Kellner 2022-02-25 21:09:11 +01:00 committed by Tom Gundersen
parent e994f7b9d4
commit 898a0f176a

View file

@ -275,6 +275,7 @@ class Cli(contextlib.AbstractContextManager):
else:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self._exitstack.enter_context(contextlib.closing(sock))
os.makedirs("/run/osbuild-dnf-json/", exist_ok=True)
sock.bind("/run/osbuild-dnf-json/api.sock")
sock.listen()