From a4b2b0a734d8b24a8ee11335fe6829cc3d99778e Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 13 Feb 2017 15:53:47 -0600 Subject: [PATCH] Small fix for 350a32bd to make it Py3 compliant --- lib/ansible/utils/vars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/utils/vars.py b/lib/ansible/utils/vars.py index 4e7830e1f2..42da5006a9 100644 --- a/lib/ansible/utils/vars.py +++ b/lib/ansible/utils/vars.py @@ -22,7 +22,6 @@ __metaclass__ = type import ast import os import random -import sys import uuid from json import dumps @@ -35,9 +34,10 @@ from ansible.errors import AnsibleError from ansible.parsing.splitter import parse_kv from ansible.module_utils._text import to_native, to_text +_MAXSIZE = 2**32 cur_id = 0 node_mac = ("%012x" % uuid.getnode())[:12] -random_int = ("%08x" % random.randint(0, sys.maxint))[:8] +random_int = ("%08x" % random.randint(0, _MAXSIZE))[:8] def get_unique_id(): global cur_id