mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Remove host entry if it is the last alias
This commit is contained in:
parent
782574b58e
commit
b0fe7c8647
@ -122,7 +122,10 @@ def rm_host(ip, alias):
|
||||
if existing == alias:
|
||||
continue
|
||||
newline += '\t' + existing
|
||||
lines[ind] = newline
|
||||
if newline.strip() == ip:
|
||||
lines[ind] = ''
|
||||
else:
|
||||
lines[ind] = newline
|
||||
open(hfn, 'w+').writelines(lines)
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user