[X2Go-Commits] [x2gobroker] 02/02: Don't load defaults.conf twice. Only load it when initializing the loggers.

git-admin at x2go.org git-admin at x2go.org
Wed Oct 29 14:41:44 CET 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gobroker.

commit 70a82df06b8a9609d334c739c5b38222cd709fe4
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Oct 29 14:41:40 2014 +0100

    Don't load defaults.conf twice. Only load it when initializing the loggers.
---
 debian/changelog       |    2 ++
 x2gobroker/defaults.py |   11 +++--------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e4958bd..3bb637d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -175,6 +175,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low
     - Load defaults.conf via authservices and for logger configuration, as well.
     - x2gobroker-authservice: Make sure socket file directory is created
       before trying to create the socket file itself.
+    - Don't load defaults.conf twice. Only load it when initializing the
+      loggers.
   * debian/control:
     + Provide separate bin:package for SSH brokerage: x2gobroker-ssh.
     + Replace LDAP support with session brokerage support in LONG_DESCRIPTION.
diff --git a/x2gobroker/defaults.py b/x2gobroker/defaults.py
index 43e7761..74fad61 100644
--- a/x2gobroker/defaults.py
+++ b/x2gobroker/defaults.py
@@ -28,6 +28,9 @@ import pwd, grp
 
 import logging
 from loggers import logger_broker, logger_access, logger_error, X2GOBROKER_DAEMON_USER
+from loggers import iniconfig_loaded
+if iniconfig_loaded:
+    from loggers import iniconfig, iniconfig_section
 
 X2GOBROKER_USER =  pwd.getpwuid(os.geteuid())[0]
 X2GOBROKER_GROUP =  grp.getgrgid(pwd.getpwuid(os.geteuid())[3])[0]
@@ -35,14 +38,6 @@ os.environ['HOME'] = pwd.getpwuid(os.geteuid())[5]
 
 PROG_NAME = os.path.basename(sys.argv[0])
 
-iniconfig_loaded = None
-iniconfig_section = '-'.join(PROG_NAME.split('-')[1:])
-X2GOBROKER_DEFAULTS = "/etc/x2go/broker/defaults.conf"
-if os.path.isfile(X2GOBROKER_DEFAULTS) and os.access(X2GOBROKER_DEFAULTS, os.R_OK):
-    iniconfig = ConfigParser.SafeConfigParser()
-    iniconfig.optionxform = str
-    iniconfig_loaded = iniconfig.read(X2GOBROKER_DEFAULTS)
-
 if os.environ.has_key('X2GOBROKER_DAEMON_GROUP'):
     X2GOBROKER_DAEMON_GROUP=os.environ['X2GOBROKER_DAEMON_GROUP']
 elif iniconfig_loaded and iniconfig.has_option(iniconfig_section, 'X2GOBROKER_DAEMON_GROUP'):

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git


More information about the x2go-commits mailing list