reversed the logic on new setting to control - replacment in groups as

it was wrong
fixes #13122
This commit is contained in:
Brian Coca 2015-11-11 13:34:19 -08:00
parent 4737305837
commit b2a9111b22

View file

@ -1294,7 +1294,7 @@ class Ec2Inventory(object):
def to_safe(self, word): def to_safe(self, word):
''' Converts 'bad' characters in a string to underscores so they can be used as Ansible groups ''' ''' Converts 'bad' characters in a string to underscores so they can be used as Ansible groups '''
regex = "[^A-Za-z0-9\_" regex = "[^A-Za-z0-9\_"
if self.replace_dash_in_groups: if not self.replace_dash_in_groups:
regex += "\-" regex += "\-"
return re.sub(regex + "]", "_", word) return re.sub(regex + "]", "_", word)