From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit adds the option to redirect the directory where slaves
locally store their logs. The option is named 'log_dir' and is placed in
the section 'environment' same as for the controller configuration.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst-slave | 2 +-
lnst-slave.conf | 2 ++
lnst/Common/Config.py | 8 ++++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/lnst-slave b/lnst-slave
index 3a66c2f..4244209 100755
--- a/lnst-slave
+++ b/lnst-slave
@@ -72,7 +72,7 @@ def main():
elif opt in ("-p", "--port"):
port = int(arg)
- Logs(debug, True)
+ Logs(debug, True, log_folder=config.get_option('environment',
'log_dir'))
logging.info("Started")
if port:
diff --git a/lnst-slave.conf b/lnst-slave.conf
index 924d0c7..5689819 100644
--- a/lnst-slave.conf
+++ b/lnst-slave.conf
@@ -1,3 +1,5 @@
[cache]
cache_dir = ./cache
expiration_period = 7days
+[environment]
+log_dir = ./Logs
diff --git a/lnst/Common/Config.py b/lnst/Common/Config.py
index d49a2d9..3d65048 100644
--- a/lnst/Common/Config.py
+++ b/lnst/Common/Config.py
@@ -74,6 +74,14 @@ class Config():
"name" : "log_dir"}
def slave_scheme(self):
+ self.options['environment'] = dict()
+ self.options['environment']['log_dir'] = {\
+ "value" : os.path.abspath(os.path.join(
+ os.path.dirname(sys.argv[0]), './Logs')),
+ "additive" : False,
+ "action" : self.optionPath,
+ "name" : "log_dir"}
+
self.options['cache'] = dict()
self.options['cache']['dir'] = {\
"value" : os.path.abspath(os.path.join(
--
1.7.11.7