SHA256
1
0
forked from pool/vagrant
vagrant/0002-Disable-Checkpoint.patch

72 lines
2.3 KiB
Diff
Raw Normal View History

From: Antonio Terceiro <terceiro@debian.org>
Date: Sat, 11 Oct 2014 16:48:07 -0300
Subject: Disable Checkpoint
We don't want vagrant phoning home all the time
---
lib/vagrant/environment.rb | 38 ++------------------------------------
1 file changed, 2 insertions(+), 36 deletions(-)
--- a/lib/vagrant/environment.rb
+++ b/lib/vagrant/environment.rb
@@ -4,7 +4,6 @@ require 'pathname'
require 'set'
require 'thread'
-require "checkpoint"
require 'log4r'
require 'vagrant/util/file_mode'
@@ -128,34 +127,6 @@ module Vagrant
# Prepare the directories
setup_home_path
- # Run checkpoint in a background thread on every environment
- # initialization. The cache file will cause this to mostly be a no-op
- # most of the time.
- @checkpoint_thr = Thread.new do
- Thread.current[:result] = nil
-
- # If we disabled checkpoint via env var, don't run this
- if ENV["VAGRANT_CHECKPOINT_DISABLE"].to_s != ""
- @logger.info("checkpoint: disabled from env var")
- next
- end
-
- # If we disabled state and knowing what alerts we've seen, then
- # disable the signature file.
- signature_file = @data_dir.join("checkpoint_signature")
- if ENV["VAGRANT_CHECKPOINT_NO_STATE"].to_s != ""
- @logger.info("checkpoint: will not store state")
- signature_file = nil
- end
-
- Thread.current[:result] = Checkpoint.check(
- product: "vagrant",
- version: VERSION,
- signature_file: signature_file,
- cache_file: @data_dir.join("checkpoint_cache"),
- )
- end
-
# Setup the local data directory. If a configuration path is given,
# then it is expanded relative to the working directory. Otherwise,
# we use the default which is expanded relative to the root path.
@@ -283,14 +254,9 @@ module Vagrant
end
end
- # Checkpoint returns the checkpoint result data. If checkpoint is
- # disabled, this will return nil. See the hashicorp-checkpoint gem
- # for more documentation on the return value.
- #
- # @return [Hash]
+ # Usage of the checkpoint service is disabled in the Debian package.
def checkpoint
- @checkpoint_thr.join
- return @checkpoint_thr[:result]
+ nil
end
# Makes a call to the CLI with the given arguments as if they