Fix log dest dir path
This commit is contained in:
parent
2500696c10
commit
0c1d0c6f33
@ -186,17 +186,17 @@ def execute_to_log(cmd, logfile, timeout=-1,
|
||||
log_hanlder.close()
|
||||
|
||||
|
||||
def push_file(dest_dir, file_path, publish_config):
|
||||
def push_file(job_log_dir, file_path, publish_config):
|
||||
""" Push a log file to a server. Returns the public URL """
|
||||
method = publish_config['type'] + '_push_file'
|
||||
if method in globals() and hasattr(globals()[method], '__call__'):
|
||||
return globals()[method](dest_dir, file_path, publish_config)
|
||||
|
||||
|
||||
def swift_push_file(dest_dir, file_path, swift_config):
|
||||
def swift_push_file(job_log_dir, file_path, swift_config):
|
||||
""" Push a log file to a swift server. """
|
||||
with open(file_path, 'r') as fd:
|
||||
name = dest_dir + '_' + os.path.basename(file_path)
|
||||
name = job_log_dir + '_' + os.path.basename(file_path)
|
||||
con = swiftclient.client.Connection(swift_config['authurl'],
|
||||
swift_config['user'],
|
||||
swift_config['apikey'])
|
||||
@ -204,9 +204,9 @@ def swift_push_file(dest_dir, file_path, swift_config):
|
||||
return obj
|
||||
|
||||
|
||||
def local_push_file(dest_dir, file_path, local_config):
|
||||
def local_push_file(job_log_dir, file_path, local_config):
|
||||
""" Copy the file locally somewhere sensible """
|
||||
dest_dir = os.path.join(local_config['path'], dest_dir)
|
||||
dest_dir = os.path.join(local_config['path'], job_log_dir)
|
||||
dest_filename = os.path.basename(file_path)
|
||||
if not os.path.isdir(dest_dir):
|
||||
os.makedirs(dest_dir)
|
||||
@ -217,7 +217,7 @@ def local_push_file(dest_dir, file_path, local_config):
|
||||
return local_config['prepend_url'] + os.path.join(dest_dir, dest_filename)
|
||||
|
||||
|
||||
def scp_push_file(dest_dir, file_path, local_config):
|
||||
def scp_push_file(job_log_dir, file_path, local_config):
|
||||
""" Copy the file remotely over ssh """
|
||||
pass
|
||||
|
||||
|
@ -56,8 +56,7 @@ def generate_push_results(datasets, publish_config):
|
||||
""" Generates and pushes results """
|
||||
|
||||
for i, dataset in enumerate(datasets):
|
||||
result_uri = push_file(dataset['determined_path'],
|
||||
dataset['log_file_path'],
|
||||
result_uri = push_file(dataset['job_log_file_path'],
|
||||
publish_config)
|
||||
datasets[i]['result_uri'] = result_uri
|
||||
|
||||
|
@ -169,8 +169,8 @@ class Runner(threading.Thread):
|
||||
for i, dataset in enumerate(self.job_datasets):
|
||||
# Look for the beginning of the migration start
|
||||
dataset_success, message = \
|
||||
handle_results.check_log_for_errors(dataset['log_file_path'],
|
||||
self.git_path)
|
||||
handle_results.check_log_for_errors(
|
||||
dataset['job_log_file_path'], self.git_path)
|
||||
self.job_datasets[i]['result'] = message
|
||||
success = False if not dataset_success else success
|
||||
|
||||
@ -217,7 +217,7 @@ class Runner(threading.Thread):
|
||||
self.job_arguments, self.plugin_config['job'],
|
||||
self.job.unique
|
||||
)
|
||||
dataset['log_file_path'] = os.path.join(
|
||||
dataset['job_log_file_path'] = os.path.join(
|
||||
self.global_config['jobs_working_dir'],
|
||||
dataset['determined_path'],
|
||||
dataset['name'] + '.log'
|
||||
@ -296,7 +296,7 @@ class Runner(threading.Thread):
|
||||
|
||||
utils.execute_to_log(
|
||||
cmd,
|
||||
dataset['log_file_path'],
|
||||
dataset['job_log_file_path'],
|
||||
watch_logs=[
|
||||
('[syslog]', syslog),
|
||||
('[sqlslo]', sqlslo),
|
||||
|
Loading…
x
Reference in New Issue
Block a user