From 3a3e69f8302f4536ffaf8a0825b75af188ee1dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Ner=C3=ADn?= Date: Mon, 25 Apr 2016 15:22:00 +0100 Subject: [PATCH] Fix substituting dots for underscores when using ips (#15578) ec2.py was substituting the dots on ip addresses when not using hostnames like: "ec2": [ "10_10_1_1", now it's: "ec2": [ "10.10.1.1", --- contrib/inventory/ec2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index f0214b61f06..c5028d5206d 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -668,8 +668,8 @@ class Ec2Inventory(object): # If we can't get a nice hostname, use the destination address if not hostname: hostname = dest - - hostname = self.to_safe(hostname).lower() + else: + hostname = self.to_safe(hostname).lower() # if we only want to include hosts that match a pattern, skip those that don't if self.pattern_include and not self.pattern_include.match(hostname):