diff --git a/README.md b/README.md index 5271a7d..5a5b962 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ By setting the remove\_on\_suspend option, you can have them removed on **suspen ## Versions +### 0.0.9 +* bugfix: now not trying to remove anything if no machine id is given + ### 0.0.8 * trying to use proper windows hosts file diff --git a/lib/vagrant-hostsupdater/HostsUpdater.rb b/lib/vagrant-hostsupdater/HostsUpdater.rb index 493af85..213cfbe 100644 --- a/lib/vagrant-hostsupdater/HostsUpdater.rb +++ b/lib/vagrant-hostsupdater/HostsUpdater.rb @@ -43,6 +43,10 @@ def addHostEntries() end def removeHostEntries + if !@machine.id + @ui.warn "No machine id, nothing removed from #@@hosts_path" + return + end file = File.open(@@hosts_path, "rb") hostsContents = file.read uuid = @machine.id diff --git a/lib/vagrant-hostsupdater/version.rb b/lib/vagrant-hostsupdater/version.rb index 8a13717..9757de2 100644 --- a/lib/vagrant-hostsupdater/version.rb +++ b/lib/vagrant-hostsupdater/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module HostsUpdater - VERSION = "0.0.8" + VERSION = "0.0.9" end end