This commit is contained in:
parent
11653785ea
commit
fe37d893c7
|
@ -336,7 +336,9 @@ def upgrade_check_times(location_config, borg_repository_id):
|
|||
|
||||
~/.borgmatic/checks/1234567890/archives/all
|
||||
'''
|
||||
logger.debug(f"#713: upgrade_check_times(location_config={location_config}, borg_repository_id='{borg_repository_id}')")
|
||||
logger.debug(
|
||||
f"#713: upgrade_check_times(location_config={location_config}, borg_repository_id='{borg_repository_id}')"
|
||||
)
|
||||
|
||||
for check_type in ('archives', 'data'):
|
||||
logger.debug(f"#713: check_type = '{check_type}'")
|
||||
|
@ -348,7 +350,11 @@ def upgrade_check_times(location_config, borg_repository_id):
|
|||
logger.debug(f"#713: temporary_path = '{temporary_path}'")
|
||||
|
||||
logger.debug(f"\n#713: file listing:")
|
||||
logger.debug(execute_command_and_capture_output(['ls', '-alR', f'{os.path.dirname(old_path)}'], capture_stderr=True, shell=True))
|
||||
logger.debug(
|
||||
execute_command_and_capture_output(
|
||||
['ls', '-alR', f'{os.path.dirname(old_path)}'], capture_stderr=True, shell=True
|
||||
)
|
||||
)
|
||||
logger.debug(f"#713: os.path.isfile(old_path) = {os.path.isfile(old_path)}")
|
||||
logger.debug(f"#713: os.path.isfile(temporary_path) = {os.path.isfile(temporary_path)}")
|
||||
|
||||
|
|
|
@ -515,6 +515,7 @@ def test_probe_for_check_time_returns_none_when_no_check_time_found():
|
|||
|
||||
def test_upgrade_check_times_renames_old_check_paths_to_all():
|
||||
base_path = '~/.borgmatic/checks/1234'
|
||||
flexmock(module).should_receive('execute_command_and_capture_output').and_return('')
|
||||
flexmock(module).should_receive('make_check_time_path').with_args(
|
||||
object, object, 'archives', 'all'
|
||||
).and_return(f'{base_path}/archives/all')
|
||||
|
@ -545,6 +546,7 @@ def test_upgrade_check_times_renames_old_check_paths_to_all():
|
|||
|
||||
|
||||
def test_upgrade_check_times_skips_missing_check_paths():
|
||||
flexmock(module).should_receive('execute_command_and_capture_output').and_return('')
|
||||
flexmock(module).should_receive('make_check_time_path').and_return(
|
||||
'~/.borgmatic/checks/1234/archives/all'
|
||||
)
|
||||
|
@ -557,6 +559,7 @@ def test_upgrade_check_times_skips_missing_check_paths():
|
|||
|
||||
def test_upgrade_check_times_renames_stale_temporary_check_path():
|
||||
base_path = '~/.borgmatic/checks/1234'
|
||||
flexmock(module).should_receive('execute_command_and_capture_output').and_return('')
|
||||
flexmock(module).should_receive('make_check_time_path').with_args(
|
||||
object, object, 'archives', 'all'
|
||||
).and_return(f'{base_path}/archives/all')
|
||||
|
|
Loading…
Reference in New Issue
Block a user