From 8900c6b2eec8124d43d617197dc1381480d7915a Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Fri, 20 Nov 2020 21:36:08 +0100 Subject: [PATCH] Fix the check when the box could be un-registered It was a sad mistake there. If we start the lease counter with 0, we should obviously expect to get back to 0 when the last VM cloning the the box is ready to release it. --- lib/vagrant-parallels/action/box_unregister.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-parallels/action/box_unregister.rb b/lib/vagrant-parallels/action/box_unregister.rb index 8be49110..87df13ba 100644 --- a/lib/vagrant-parallels/action/box_unregister.rb +++ b/lib/vagrant-parallels/action/box_unregister.rb @@ -53,9 +53,9 @@ def release_box_lock(lease_file) file.flush end - # Delete the lease file if we are the last who need this box. + # Delete the lease file if we were the last who needed this box. # Then the box image will be unregistered. - lease_file.delete if lease_file.read.chomp.to_i <= 1 + lease_file.delete if lease_file.read.chomp.to_i <= 0 end def unregister_box(env)