Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved config parsing to monitor module

  • Loading branch information...
commit 60898c690d63f471cf3768942ebadea901fc7f4a 1 parent f7a3ffa
@jbohman authored
View
6 logsandra/config/__init__.py
@@ -1,6 +0,0 @@
-# Global import
-import yaml
-
-def parse(config_file):
- file_handler = open(config_file)
- return yaml.load(file_handler.read())
View
1  logsandra/monitor/__init__.py
@@ -1 +0,0 @@
-from monitor import Monitor
View
6 logsandra/monitor/config.py
@@ -0,0 +1,6 @@
+# Global import
+import yaml
+
+def parse(config_file):
+ file_handler = open(config_file)
+ return yaml.load(file_handler.read())
View
12 run.py
@@ -11,9 +11,9 @@
from paste.deploy import loadapp
# Local imports
-from logsandra import monitor, config, utils
+from logsandra import utils
from logsandra.utils.daemon import Daemon
-
+from logsandra.monitor import config, monitor
class Application(Daemon):
@@ -25,7 +25,7 @@ def monitor(self):
def run(self):
# Setup logging
- logging.basicConfig(filename=self.settings['logfile_name'], level=logging.DEBUG)
+ logging.basicConfig(filename=self.settings['logfile'], level=logging.DEBUG)
# Test to see if settings is present
if not hasattr(self, 'settings'):
@@ -65,12 +65,12 @@ def run(self):
if not os.path.isdir(options.application_data_directory):
os.makedirs(options.application_data_directory)
- output_file = os.path.join(options.application_data_directory, 'logsandra.log')
+ logfile = os.path.join(options.application_data_directory, 'logsandra.log')
- application = Application(options.pid_file, stdout=output_file, stderr=output_file)
+ application = Application(options.pid_file, stdout=logfile, stderr=logfile)
application.settings = config.parse(options.config_file)
application.settings['application_data_directory'] = options.application_data_directory
- application.settings['logfile_name'] = output_file
+ application.settings['logfile'] = logfile
if len(args) == 1:
if args[0] == 'start':
Please sign in to comment.
Something went wrong with that request. Please try again.