Skip to content

Commit

Permalink
Merge pull request #268 from autogun/master
Browse files Browse the repository at this point in the history
Logs - replace forward slash (/) with underscore
  • Loading branch information
bugy authored Mar 7, 2020
2 parents f33c9a9 + af78926 commit dbd3f50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/execution/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def create_filename(self, execution_id, all_audit_names, script_name, start_time
if not filename.lower().endswith('.log'):
filename += '.log'

filename = filename.replace(" ", "_")
filename = filename.replace(" ", "_").replace("/", "_")

return filename

Expand Down
4 changes: 2 additions & 2 deletions src/tests/execution_filename_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def test_default_format(self):
self.assertEqual(filename, 'my_script_bugy_180506_083026.log')

def test_custom_date_format(self):
filename = self.create_filename(date_format='xx%y/%m/%d-%fxx')
self.assertEqual(filename, 'my_script_bugy_xx18/05/06-234000xx.log')
filename = self.create_filename(date_format='xx%y-%m-%d_%fxx')
self.assertEqual(filename, 'my_script_bugy_xx18-05-06_234000xx.log')

def test_custom_name_id_only(self):
filename = self.create_filename(filename_pattern='$ID')
Expand Down

0 comments on commit dbd3f50

Please sign in to comment.