The issue is that the content string is reinitialized with the contents of the already existing "resolv.conf" file as following. But the file only contains commented line.
if existing_dns_path and os.path.isfile(existing_dns_path):
content = resolv_conf.ResolvConf(util.load_file(existing_dns_path))
So even though there is no name servers nor search domains added to the content, It's still not empty. And the check (not str(content)) will return false. The header will be added to the content and the file will be modified. So netconfig is not touching it.
The issue is that the content string is reinitialized with the contents of the already existing "resolv.conf" file as following. But the file only contains commented line.
if existing_dns_path and os.path. isfile( existing_ dns_path) : conf.ResolvConf (util.load_ file(existing_ dns_path) )
content = resolv_
So even though there is no name servers nor search domains added to the content, It's still not empty. And the check (not str(content)) will return false. The header will be added to the content and the file will be modified. So netconfig is not touching it.
if not str(content):
return None