- # if there's no ipv6 address anymore, then remove everything from the /etc/hosts
- tools.remove_all_ipv6addr_hosts(slice['name'], data['hostname'])
+ result = tools.search_ipv6addr_hosts(slice['name'], value)
+ if result:
+ # if there's any ipv6 address, then remove everything from the /etc/hosts
+ tools.remove_all_ipv6addr_hosts(slice['name'], data['hostname'])