From 99a30f8fdb19ce7ebc688ac36188271070fb023d Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 2 Jun 2017 12:41:02 -0500 Subject: [PATCH] Python3 fix for hashing in inventory plugins --- lib/ansible/plugins/inventory/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/inventory/__init__.py b/lib/ansible/plugins/inventory/__init__.py index 706e8215016..e5e6716ae5c 100644 --- a/lib/ansible/plugins/inventory/__init__.py +++ b/lib/ansible/plugins/inventory/__init__.py @@ -61,11 +61,11 @@ class BaseInventoryPlugin(object): ''' create predictable unique prefix for plugin/inventory ''' m = hashlib.sha1() - m.update(self.NAME) + m.update(to_bytes(self.NAME)) d1 = m.hexdigest() n = hashlib.sha1() - n.update(path) + n.update(to_bytes(path)) d2 = n.hexdigest() return 's_'.join([d1[:5], d2[:5]])