From b1f27ca902333108dcd7a5f7e976259f5cdc41e0 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Fri, 15 Nov 2013 14:00:04 +0100 Subject: [PATCH] host: fix bug, alias was not removed --- system/host | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/system/host b/system/host index db37d1da786..3720ccc1017 100644 --- a/system/host +++ b/system/host @@ -116,14 +116,12 @@ class Host(object): # only look at aliases if we found hostname or ip if self._hostname_matches or self._ip_matches: - if self.aliases and self.aliases == aliases: + if self.aliases == aliases: self._aliases_matches = True break def full_entry_exists(self): - if self.aliases and not self._aliases_matches: - return False - return self._ip_matches and self._hostname_matches + return self._ip_matches and self._hostname_matches and self._aliases_matches def entry_exists(self): return self._ip_matches or self._hostname_matches @@ -154,7 +152,7 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), ip=dict(default=None, type='str'), hostname=dict(default=None, type='str'), - aliases=dict(default=None, type='str'), + aliases=dict(default='', type='str'), ), supports_check_mode=True )