from . import uploads
from . import users
+log = logging.getLogger("backend")
+log.propagate = 1
+
# Import version
from .__version__ import VERSION as __version__
from .constants import *
class Backend(object):
- def __init__(self, config_file="pbs.conf"):
+ def __init__(self, config_file=None):
# Read configuration file.
self.config = self.read_config(config_file)
def read_config(self, path):
c = ConfigParser.SafeConfigParser()
- c.read(path)
+
+ # Load default configuration file first
+ paths = [
+ os.path.join(CONFIGSDIR, "pbs.conf"),
+ ]
+
+ if path:
+ paths.append(path)
+
+ # Load all configuration files
+ for path in paths:
+ log.debug("Loading configuration from %s" % path)
+ c.read(path)
return c
@property
def pakfire(self):
if self.__pakfire is None:
- config_file = os.path.join(BASEDIR, "..", "pbs.conf")
-
- self.__pakfire = Backend(config_file=config_file)
+ self.__pakfire = Backend()
return self.__pakfire
@property
def pakfire(self):
if self.__pakfire is None:
- config_file = os.path.join(BASEDIR, "..", "pbs.conf")
-
- self.__pakfire = Backend(config_file=config_file)
+ self.__pakfire = Backend()
return self.__pakfire