[X2Go-Commits] [x2gobroker] 01/02: x2gobroker/defaults.py: Gracefully handle API documentation builds during offline builds.
git-admin at x2go.org
git-admin at x2go.org
Mon Nov 15 15:34:28 CET 2021
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2gobroker.
commit cc1b789e383dfcb8932daf05f1a22c0a1c998b0d
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Nov 15 15:33:16 2021 +0100
x2gobroker/defaults.py: Gracefully handle API documentation builds during offline builds.
---
x2gobroker/defaults.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/x2gobroker/defaults.py b/x2gobroker/defaults.py
index ec36301..0b697cc 100644
--- a/x2gobroker/defaults.py
+++ b/x2gobroker/defaults.py
@@ -204,10 +204,13 @@ elif iniconfig_loaded and iniconfig.has_option('daemon', 'X2GOBROKER_SSL_KEYFILE
### static / hard-coded defaults
###
-if socket.gethostname().find('.') >= 0:
- X2GOBROKER_HOSTNAME = socket.gethostname()
-else:
- X2GOBROKER_HOSTNAME = socket.gethostbyaddr(socket.gethostname())[0]
+try:
+ if socket.gethostname().find('.') >= 0:
+ X2GOBROKER_HOSTNAME = socket.gethostname()
+ else:
+ X2GOBROKER_HOSTNAME = socket.gethostbyaddr(socket.gethostname())[0]
+except socket.gaierror:
+ X2GOBROKER_HOSTNAME = 'localhost'
# the home directory of the user that the daemon/cgi runs as
X2GOBROKER_HOME = os.path.normpath(os.path.expanduser('~{broker_uid}'.format(broker_uid=X2GOBROKER_DAEMON_USER)))
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
More information about the x2go-commits
mailing list