mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Partially python3fy ansible.module_utils.basic
Adding __metaclass__ = type breaks things, so I didn't include it.
This commit is contained in:
parent
dc08bca1fd
commit
e1ae082a1e
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
||||||
# Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016
|
# Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
SIZE_RANGES = {
|
SIZE_RANGES = {
|
||||||
'Y': 1 << 80,
|
'Y': 1 << 80,
|
||||||
'Z': 1 << 70,
|
'Z': 1 << 70,
|
||||||
|
@ -621,7 +623,7 @@ def bytes_to_human(size, isbits=False, unit=None):
|
||||||
else:
|
else:
|
||||||
suffix = base
|
suffix = base
|
||||||
|
|
||||||
return '%.2f %s' % (float(size) / limit, suffix)
|
return '%.2f %s' % (size / limit, suffix)
|
||||||
|
|
||||||
|
|
||||||
def human_to_bytes(number, default_unit=None, isbits=False):
|
def human_to_bytes(number, default_unit=None, isbits=False):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue