Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only report archive dirs if configured #138

Merged
merged 3 commits into from
Apr 28, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/plotman/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,14 @@ def arch_dir_report(archdir_freebytes, width, prefix=''):

# TODO: remove this
def dirs_report(jobs, dir_cfg, sched_cfg, width):
return (
tmp_dir_report(jobs, dir_cfg, sched_cfg, width) + '\n' +
dst_dir_report(jobs, dir_cfg.dst, width) + '\n' +
'archive dirs free space:\n' +
arch_dir_report(archive.get_archdir_freebytes(dir_cfg.archive), width) + '\n'
)

reports = [
tmp_dir_report(jobs, dir_cfg, sched_cfg, width),
dst_dir_report(jobs, dir_cfg.dst, width),
]
if dir_cfg.archive is not None:
reports.extend([
'archive dirs free space:',
arch_dir_report(archive.get_archdir_freebytes(dir_cfg.archive), width),
])

return '\n'.join(reports) + '\n'