From e8768b2b87f211467de67b8be1e3d218f9c46404 Mon Sep 17 00:00:00 2001 From: Paul Logston Date: Sat, 25 Apr 2015 19:45:22 -0400 Subject: [PATCH] Use six to check for string_types --- plugins/inventory/ec2.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/inventory/ec2.py b/plugins/inventory/ec2.py index ad92c16b9d..16ac93f5ee 100755 --- a/plugins/inventory/ec2.py +++ b/plugins/inventory/ec2.py @@ -694,9 +694,7 @@ class Ec2Inventory(object): instance_vars['ec2_previous_state_code'] = instance.previous_state_code elif type(value) in [int, bool]: instance_vars[key] = value - elif six.PY2 and type(value) in [str, unicode]: - instance_vars[key] = value.strip() - elif six.PY3 and type(value) in [str]: + elif isinstance(value, six.string_types): instance_vars[key] = value.strip() elif type(value) == type(None): instance_vars[key] = ''