From e1ae082a1e47b93841bc68f4607973f13dd32be1 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sun, 13 May 2018 23:12:12 +0200 Subject: [PATCH] Partially python3fy ansible.module_utils.basic Adding __metaclass__ = type breaks things, so I didn't include it. --- lib/ansible/module_utils/basic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 0043b67652..53e11441a1 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -2,6 +2,8 @@ # Copyright (c), Toshio Kuratomi 2016 # 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 = { 'Y': 1 << 80, 'Z': 1 << 70, @@ -621,7 +623,7 @@ def bytes_to_human(size, isbits=False, unit=None): else: 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):