Skip to content

Commit

Permalink
utils: add block size arg to disk usage function
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidalgarcia committed Jan 10, 2020
1 parent fd9e20f commit 9723440
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions reana_commons/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,13 @@ def build_caching_info_message(job_spec,
return caching_info_message


def get_workspace_disk_usage(workspace, summarize=False):
def get_workspace_disk_usage(workspace, summarize=False, block_size=None):
"""Retrieve disk usage information of a workspace."""
command = ['du', '-h']
command = ['du']
if block_size in ['b', 'k']:
command.append('-{}'.format(block_size))
else:
command.append('-h')
if summarize:
command.append('-s')
else:
Expand Down
2 changes: 1 addition & 1 deletion reana_commons/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

from __future__ import absolute_import, print_function

__version__ = "0.7.0.dev20191220"
__version__ = "0.7.0.dev20200110"

0 comments on commit 9723440

Please sign in to comment.