X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fupdate_ipv6addr_slivertag.py;fp=plugins%2Fupdate_ipv6addr_slivertag.py;h=859b13dfb5ea03799c869811162b9a37f817ab78;hb=99b060ddf18bc5f78c976b269da9c9afe65af1e5;hp=3f63c2d39fbe131754aa63e8f35658a645d3f2f5;hpb=2f6d47b36f7f01810b3c1683c2e351c601f8aed3;p=nodemanager.git diff --git a/plugins/update_ipv6addr_slivertag.py b/plugins/update_ipv6addr_slivertag.py index 3f63c2d..859b13d 100644 --- a/plugins/update_ipv6addr_slivertag.py +++ b/plugins/update_ipv6addr_slivertag.py @@ -62,8 +62,10 @@ def SetSliverTag(plc, data, tagname): except: logger.log("update_ipv6addr_slivertag: slice tag not deleted for slice=%s" % \ (slice['name']) ) - # 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']) else: # if the ipv6 addr set on the slice does not exist yet, so, let's add it if (ipv6addr is None) and len(value)>0: