]> git.ipfire.org Git - pakfire.git/commitdiff
daemon: Use Python socket module to get hostname
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 May 2022 12:03:49 +0000 (12:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 May 2022 12:03:49 +0000 (12:03 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/daemon.py

index 74a3ef6daecb8f70c47fe4f2c2ff9de07f7840fa..b2bd43fb5296fc0e44498a61d9a3d2b13b892a1f 100644 (file)
@@ -6,6 +6,7 @@ import json
 import multiprocessing
 import os
 import signal
+import socket
 import sys
 import tempfile
 import time
@@ -61,7 +62,7 @@ class Daemon(object):
                url = self.config.get("daemon", "server", PAKFIRE_HUB)
 
                # Host Credentials
-               hostname = self.config.get("daemon", "hostname", system.hostname)
+               hostname = self.config.get("daemon", "hostname", socket.gethostname())
                password = self.config.get("daemon", "secret")
 
                if not hostname or not password: