From b2a9111b22dcd9662c0ae1537913a810e70b5c5c Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 11 Nov 2015 13:34:19 -0800 Subject: [PATCH] reversed the logic on new setting to control - replacment in groups as it was wrong fixes #13122 --- contrib/inventory/ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index b8b1d43deac..0208ed1fde5 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -1294,7 +1294,7 @@ class Ec2Inventory(object): def to_safe(self, word): ''' Converts 'bad' characters in a string to underscores so they can be used as Ansible groups ''' regex = "[^A-Za-z0-9\_" - if self.replace_dash_in_groups: + if not self.replace_dash_in_groups: regex += "\-" return re.sub(regex + "]", "_", word)