Commit e2f89202 authored by Jérome Perrin's avatar Jérome Perrin

testnode: make the number of days to keep log configurable

parent e6034f39
Pipeline #9118 failed with stage
in 0 seconds
...@@ -74,7 +74,7 @@ def main(*args): ...@@ -74,7 +74,7 @@ def main(*args):
'proxy_port', 'git_binary','zip_binary','node_quantity', 'proxy_port', 'git_binary','zip_binary','node_quantity',
'test_node_title', 'ipv4_address','ipv6_address','test_suite_master_url', 'test_node_title', 'ipv4_address','ipv6_address','test_suite_master_url',
'slapos_binary', 'httpd_ip', 'httpd_port', 'httpd_software_access_port', 'slapos_binary', 'httpd_ip', 'httpd_port', 'httpd_software_access_port',
'computer_id', 'server_url', 'shared_part_list'): 'computer_id', 'server_url', 'shared_part_list', 'keep_log_days'):
CONFIG[key] = config.get('testnode',key) CONFIG[key] = config.get('testnode',key)
for key in ('slapos_directory', 'working_directory', 'test_suite_directory', for key in ('slapos_directory', 'working_directory', 'test_suite_directory',
......
...@@ -41,8 +41,6 @@ from .Utils import deunicodeData ...@@ -41,8 +41,6 @@ from .Utils import deunicodeData
from .Utils import rmtree from .Utils import rmtree
from .. import taskdistribution from .. import taskdistribution
MAX_LOG_TIME = 15 # time in days we should keep logs that we can see through
# httd
MAX_TEMP_TIME = 0.01 # time in days we should keep temp files MAX_TEMP_TIME = 0.01 # time in days we should keep temp files
PROFILE_PATH_KEY = 'profile_path' PROFILE_PATH_KEY = 'profile_path'
...@@ -54,14 +52,13 @@ test_type_registry = { ...@@ -54,14 +52,13 @@ test_type_registry = {
class TestNode(object): class TestNode(object):
def __init__(self, config, max_log_time=MAX_LOG_TIME, def __init__(self, config, max_temp_time=MAX_TEMP_TIME):
max_temp_time=MAX_TEMP_TIME):
self.config = config or {} self.config = config or {}
self.process_manager = ProcessManager() self.process_manager = ProcessManager()
self.working_directory = config['working_directory'] self.working_directory = config['working_directory']
self.node_test_suite_dict = {} self.node_test_suite_dict = {}
self.file_handler = None self.file_handler = None
self.max_log_time = max_log_time self.max_log_time = float(config.get('keep_log_days', 15))
self.max_temp_time = max_temp_time self.max_temp_time = max_temp_time
self.url_access = "https://[0::0]:0123" # Ipv6 + port of the node self.url_access = "https://[0::0]:0123" # Ipv6 + port of the node
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment