| OLD | NEW |
| 1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """POSIX specific utility functions.""" | 5 """POSIX specific utility functions.""" |
| 6 | 6 |
| 7 import subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 | 10 |
| 11 def _run_df(): | 11 def _run_df(): |
| 12 """Runs df and returns the output.""" | 12 """Runs df and returns the output.""" |
| 13 proc = subprocess.Popen( | 13 proc = subprocess.Popen( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 def get_disks_info(): | 30 def get_disks_info(): |
| 31 """Returns disks info on all mount point in Mb.""" | 31 """Returns disks info on all mount point in Mb.""" |
| 32 return { | 32 return { |
| 33 items[5]: { | 33 items[5]: { |
| 34 u'free_mb': round(float(items[3]) / 1024., 1), | 34 u'free_mb': round(float(items[3]) / 1024., 1), |
| 35 u'size_mb': round(float(items[1]) / 1024., 1), | 35 u'size_mb': round(float(items[1]) / 1024., 1), |
| 36 } | 36 } |
| 37 for items in _run_df() | 37 for items in _run_df() |
| 38 } | 38 } |
| OLD | NEW |