2017-08-31 21:03:29 +02:00
|
|
|
From f12371988e650c372b44acb3347fc4348476e082 Mon Sep 17 00:00:00 2001
|
2016-04-12 19:31:48 +02:00
|
|
|
From: Antonio Terceiro <terceiro@debian.org>
|
|
|
|
Date: Sat, 11 Oct 2014 16:48:07 -0300
|
2017-08-31 21:03:29 +02:00
|
|
|
Subject: [PATCH] Disable Checkpoint
|
2016-04-12 19:31:48 +02:00
|
|
|
|
|
|
|
We don't want vagrant phoning home all the time
|
2017-08-31 21:03:29 +02:00
|
|
|
|
|
|
|
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
|
2016-04-12 19:31:48 +02:00
|
|
|
---
|
2017-03-12 20:03:16 +01:00
|
|
|
lib/vagrant/environment.rb | 38 ++-----------------------------------
|
|
|
|
plugins/commands/version/command.rb | 29 ----------------------------
|
|
|
|
2 files changed, 2 insertions(+), 65 deletions(-)
|
2016-04-12 19:31:48 +02:00
|
|
|
|
2017-03-12 20:03:16 +01:00
|
|
|
diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb
|
2017-08-31 21:03:29 +02:00
|
|
|
index 125070f3d..5d41ff028 100644
|
2016-04-12 19:31:48 +02:00
|
|
|
--- 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,
|
2017-03-12 20:03:16 +01:00
|
|
|
# it is expanded relative to the root path. Otherwise, we use the
|
|
|
|
# default (which is also expanded relative to the root path).
|
|
|
|
@@ -289,14 +260,9 @@ module Vagrant
|
2016-04-12 19:31:48 +02:00
|
|
|
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
|
2017-08-31 21:03:29 +02:00
|
|
|
- @checkpoint_thr.join(THREAD_MAX_JOIN_TIMEOUT)
|
2016-04-12 19:31:48 +02:00
|
|
|
- return @checkpoint_thr[:result]
|
|
|
|
+ nil
|
|
|
|
end
|
|
|
|
|
|
|
|
# Makes a call to the CLI with the given arguments as if they
|
2017-03-12 20:03:16 +01:00
|
|
|
diff --git a/plugins/commands/version/command.rb b/plugins/commands/version/command.rb
|
2017-08-31 21:03:29 +02:00
|
|
|
index c3c47acfa..654b2516a 100644
|
2017-03-12 20:03:16 +01:00
|
|
|
--- a/plugins/commands/version/command.rb
|
|
|
|
+++ b/plugins/commands/version/command.rb
|
|
|
|
@@ -21,35 +21,6 @@ module VagrantPlugins
|
|
|
|
"vagrant.version_current", version: Vagrant::VERSION))
|
|
|
|
@env.ui.machine("version-installed", Vagrant::VERSION)
|
|
|
|
|
|
|
|
- # Load the latest information
|
|
|
|
- cp = @env.checkpoint
|
|
|
|
- if !cp
|
|
|
|
- @env.ui.output("\n"+I18n.t(
|
|
|
|
- "vagrant.version_no_checkpoint"))
|
|
|
|
- return 0
|
|
|
|
- end
|
|
|
|
-
|
|
|
|
- latest = cp["current_version"]
|
|
|
|
-
|
|
|
|
- # Output latest version
|
|
|
|
- @env.ui.output(I18n.t(
|
|
|
|
- "vagrant.version_latest", version: latest))
|
|
|
|
- @env.ui.machine("version-latest", latest)
|
|
|
|
-
|
|
|
|
- # Determine if its a new version, and if so, output some more
|
|
|
|
- # information.
|
|
|
|
- current = Gem::Version.new(Vagrant::VERSION)
|
|
|
|
- latest = Gem::Version.new(latest)
|
|
|
|
- if current >= latest
|
|
|
|
- @env.ui.success(" \n" + I18n.t(
|
|
|
|
- "vagrant.version_latest_installed"))
|
|
|
|
- return 0
|
|
|
|
- end
|
|
|
|
-
|
|
|
|
- # Out of date! Let the user know how to upgrade.
|
|
|
|
- @env.ui.output(" \n" + I18n.t(
|
|
|
|
- "vagrant.version_upgrade_howto", version: latest.to_s))
|
|
|
|
-
|
|
|
|
0
|
|
|
|
end
|
|
|
|
end
|
2017-08-31 21:03:29 +02:00
|
|
|
--
|
|
|
|
2.13.0
|
|
|
|
|