Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian....@packages.debian.org
Usertags: pu

The platform from where vagrant downloads images has been discontinued
and we need to switch the default download location plus documentation,
usage messages etc to match the new platform. Without this update,
vagrant is pretty useless.

Changelog:

vagrant (1.9.1+dfsg-1+deb9u1) stretch; urgency=medium

  * 0008-Convert-atlas-references-to-vagrant-cloud.patch: backport upstream
    patch to download boxes from app.vagrantcloud.com instead of the
    deprecated atlas.hashicorp.com (Closes: #889873)

 -- Antonio Terceiro <terce...@debian.org>  Sun, 25 Feb 2018 21:54:18 -0300

Diff against package in stretch attached.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.14.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8), 
LANGUAGE=pt_BR:pt:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff --git a/debian/changelog b/debian/changelog
index 39dbcb2..48bff55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+vagrant (1.9.1+dfsg-1+deb9u1) stretch; urgency=medium
+
+  * 0008-Convert-atlas-references-to-vagrant-cloud.patch: backport upstream
+    patch to download boxes from app.vagrantcloud.com instead of the
+    deprecated atlas.hashicorp.com (Closes: #889873)
+
+ -- Antonio Terceiro <terce...@debian.org>  Sun, 25 Feb 2018 21:54:18 -0300
+
 vagrant (1.9.1+dfsg-1) unstable; urgency=medium
 
   * New upstream version 1.9.1+dfsg
diff --git a/debian/patches/0008-Convert-atlas-references-to-vagrant-cloud.patch b/debian/patches/0008-Convert-atlas-references-to-vagrant-cloud.patch
new file mode 100644
index 0000000..20533be
--- /dev/null
+++ b/debian/patches/0008-Convert-atlas-references-to-vagrant-cloud.patch
@@ -0,0 +1,286 @@
+From: Chris Roberts <c...@chrisroberts.org>
+Date: Sun, 25 Feb 2018 21:53:24 -0300
+Subject: Convert atlas references to vagrant cloud
+
+Backported-by: Antonio Terceiro <terce...@debian.org>
+---
+ lib/vagrant/shared_helpers.rb                       |  4 ++--
+ plugins/commands/box/command/add.rb                 |  2 +-
+ plugins/commands/login/client.rb                    | 21 ++++++++++++---------
+ plugins/commands/login/command.rb                   |  8 ++++----
+ plugins/commands/login/locales/en.yml               | 10 +++++-----
+ .../commands/login/middleware/add_authentication.rb |  3 ++-
+ plugins/commands/login/plugin.rb                    |  2 +-
+ templates/commands/init/Vagrantfile.erb             |  9 +--------
+ templates/locales/en.yml                            |  8 ++++----
+ test/unit/plugins/commands/login/client_test.rb     |  4 ++--
+ 10 files changed, 34 insertions(+), 37 deletions(-)
+
+diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb
+index ffe61e5..93f4c11 100644
+--- a/lib/vagrant/shared_helpers.rb
++++ b/lib/vagrant/shared_helpers.rb
+@@ -5,12 +5,12 @@ require "thread"
+ module Vagrant
+   @@global_lock = Mutex.new
+ 
+-  # This is the default endpoint of the Atlas in
++  # This is the default endpoint of the Vagrant Cloud in
+   # use. API calls will be made to this for various functions
+   # of Vagrant that may require remote access.
+   #
+   # @return [String]
+-  DEFAULT_SERVER_URL = "https://atlas.hashicorp.com";
++  DEFAULT_SERVER_URL = "https://vagrantcloud.com";
+ 
+   # This holds a global lock for the duration of the block. This should
+   # be invoked around anything that is modifying process state (such as
+diff --git a/plugins/commands/box/command/add.rb b/plugins/commands/box/command/add.rb
+index 5545ea2..d8ae063 100644
+--- a/plugins/commands/box/command/add.rb
++++ b/plugins/commands/box/command/add.rb
+@@ -40,7 +40,7 @@ module VagrantPlugins
+             end
+ 
+             o.separator ""
+-            o.separator "The box descriptor can be the name of a box on HashiCorp's Atlas,"
++            o.separator "The box descriptor can be the name of a box on HashiCorp's Vagrant Cloud,"
+             o.separator "or a URL, or a local .box file, or a local .json file containing"
+             o.separator "the catalog metadata."
+             o.separator ""
+diff --git a/plugins/commands/login/client.rb b/plugins/commands/login/client.rb
+index 04b6ee0..fb2dd05 100644
+--- a/plugins/commands/login/client.rb
++++ b/plugins/commands/login/client.rb
+@@ -86,28 +86,26 @@ module VagrantPlugins
+       end
+ 
+       # Reads the access token if there is one. This will first read the
+-      # `ATLAS_TOKEN` environment variable and then fallback to the stored
++      # `VAGRANT_CLOUD_TOKEN` environment variable and then fallback to the stored
+       # access token on disk.
+       #
+       # @return [String]
+       def token
+-        if present?(ENV["ATLAS_TOKEN"]) && token_path.exist?
++        if present?(ENV["VAGRANT_CLOUD_TOKEN"]) && token_path.exist?
+           @env.ui.warn <<-EOH.strip
+-Vagrant detected both the ATLAS_TOKEN environment variable and a Vagrant login
+-token are present on this system. The ATLAS_TOKEN environment variable takes
++Vagrant detected both the VAGRANT_CLOUD_TOKEN environment variable and a Vagrant login
++token are present on this system. The VAGRANT_CLOUD_TOKEN environment variable takes
+ precedence over the locally stored token. To remove this error, either unset
+-the ATLAS_TOKEN environment variable or remove the login token stored on disk:
++the VAGRANT_CLOUD_TOKEN environment variable or remove the login token stored on disk:
+ 
+     ~/.vagrant.d/data/vagrant_login_token
+ 
+-In general, the ATLAS_TOKEN is more preferred because it is respected by all
+-HashiCorp products.
+ EOH
+         end
+ 
+-        if present?(ENV["ATLAS_TOKEN"])
++        if present?(ENV["VAGRANT_CLOUD_TOKEN"])
+           @logger.debug("Using authentication token from environment variable")
+-          return ENV["ATLAS_TOKEN"]
++          return ENV["VAGRANT_CLOUD_TOKEN"]
+         end
+ 
+         if token_path.exist?
+@@ -115,6 +113,11 @@ EOH
+           return token_path.read.strip
+         end
+ 
++        if present?(ENV["ATLAS_TOKEN"])
++          @logger.warn("ATLAS_TOKEN detected within environment. Using ATLAS_TOKEN in place of VAGRANT_CLOUD_TOKEN.")
++          return ENV["ATLAS_TOKEN"]
++        end
++
+         @logger.debug("No authentication token in environment or #{token_path}")
+ 
+         nil
+diff --git a/plugins/commands/login/command.rb b/plugins/commands/login/command.rb
+index 203b090..040bbb0 100644
+--- a/plugins/commands/login/command.rb
++++ b/plugins/commands/login/command.rb
+@@ -2,7 +2,7 @@ module VagrantPlugins
+   module LoginCommand
+     class Command < Vagrant.plugin("2", "command")
+       def self.synopsis
+-        "log in to HashiCorp's Atlas"
++        "log in to HashiCorp's Vagrant Cloud"
+       end
+ 
+       def execute
+@@ -19,7 +19,7 @@ module VagrantPlugins
+             options[:logout] = k
+           end
+ 
+-          o.on("-t", "--token TOKEN", String, "Set the Atlas token") do |t|
++          o.on("-t", "--token TOKEN", String, "Set the Vagrant Cloud token") do |t|
+             options[:token] = t
+           end
+         end
+@@ -44,14 +44,14 @@ module VagrantPlugins
+ 
+         # If it is a private cloud installation, show that
+         if Vagrant.server_url != Vagrant::DEFAULT_SERVER_URL
+-          @env.ui.output("Atlas URL: #{Vagrant.server_url}")
++          @env.ui.output("Vagrant Cloud URL: #{Vagrant.server_url}")
+         end
+ 
+         # Ask for the username
+         login    = nil
+         password = nil
+         while !login
+-          login = @env.ui.ask("Atlas Username: ")
++          login = @env.ui.ask("Vagrant Cloud Username: ")
+         end
+ 
+         while !password
+diff --git a/plugins/commands/login/locales/en.yml b/plugins/commands/login/locales/en.yml
+index dba4d52..d7decaf 100644
+--- a/plugins/commands/login/locales/en.yml
++++ b/plugins/commands/login/locales/en.yml
+@@ -2,11 +2,11 @@ en:
+   login_command:
+     errors:
+       server_error: |-
+-        The Atlas server responded with an not-OK response:
++        The Vagrant Cloud server responded with an not-OK response:
+ 
+         %{errors}
+       server_unreachable: |-
+-        The Atlas server is not currently accepting connections. Please check
++        The Vagrant Cloud server is not currently accepting connections. Please check
+         your network connection and try again later.
+ 
+     check_logged_in: |-
+@@ -16,12 +16,12 @@ en:
+       your login information to authenticate.
+     command_header: |-
+       In a moment we will ask for your username and password to HashiCorp's
+-      Atlas. After authenticating, we will store an access token locally on
++      Vagrant Cloud. After authenticating, we will store an access token locally on
+       disk. Your login details will be transmitted over a secure connection, and
+       are never stored on disk locally.
+ 
+-      If you do not have an Atlas account, sign up at
+-      https://atlas.hashicorp.com.
++      If you do not have an Vagrant Cloud account, sign up at
++      https://www.vagrantcloud.com
+     invalid_login: |-
+       Invalid username or password. Please try again.
+     invalid_token: |-
+diff --git a/plugins/commands/login/middleware/add_authentication.rb b/plugins/commands/login/middleware/add_authentication.rb
+index f176e34..c82bbf6 100644
+--- a/plugins/commands/login/middleware/add_authentication.rb
++++ b/plugins/commands/login/middleware/add_authentication.rb
+@@ -29,7 +29,8 @@ module VagrantPlugins
+               # Vagrant Cloud to Atlas. This preserves access tokens
+               # appending to both without leaking access tokens to
+               # unsavory URLs.
+-              if u.host == VCLOUD && server_uri.host == ATLAS
++              if (u.host == VCLOUD && server_uri.host == ATLAS) ||
++                  (u.host == ATLAS && server_uri.host == VCLOUD)
+                 replace = true
+               end
+             end
+diff --git a/plugins/commands/login/plugin.rb b/plugins/commands/login/plugin.rb
+index efb84a5..a231bcb 100644
+--- a/plugins/commands/login/plugin.rb
++++ b/plugins/commands/login/plugin.rb
+@@ -8,7 +8,7 @@ module VagrantPlugins
+     class Plugin < Vagrant.plugin("2")
+       name "vagrant-login"
+       description <<-DESC
+-      Provides the login command and internal API access to Atlas.
++      Provides the login command and internal API access to Vagrant Cloud.
+       DESC
+ 
+       command(:login) do
+diff --git a/templates/commands/init/Vagrantfile.erb b/templates/commands/init/Vagrantfile.erb
+index d746a71..c06a008 100644
+--- a/templates/commands/init/Vagrantfile.erb
++++ b/templates/commands/init/Vagrantfile.erb
+@@ -11,7 +11,7 @@ Vagrant.configure("2") do |config|
+   # https://docs.vagrantup.com.
+ 
+   # Every Vagrant development environment requires a box. You can search for
+-  # boxes at https://atlas.hashicorp.com/search.
++  # boxes at https://vagrantcloud.com/search.
+   config.vm.box = "<%= box_name %>"
+   <% if box_version -%>
+   config.vm.box_version = "<%= box_version %>"
+@@ -63,13 +63,6 @@ Vagrant.configure("2") do |config|
+   # View the documentation for the provider you are using for more
+   # information on available options.
+ 
+-  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
+-  # such as FTP and Heroku are also available. See the documentation at
+-  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
+-  # config.push.define "atlas" do |push|
+-  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
+-  # end
+-
+   # Enable provisioning with a shell script. Additional provisioners such as
+   # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
+   # documentation for more information about their specific syntax and use.
+diff --git a/templates/locales/en.yml b/templates/locales/en.yml
+index 1dc1668..b724927 100644
+--- a/templates/locales/en.yml
++++ b/templates/locales/en.yml
+@@ -380,7 +380,7 @@ en:
+         provider. Double-check your requested provider to verify you didn't
+         simply misspell it.
+ 
+-        If you're adding a box from HashiCorp's Atlas, make sure the box is
++        If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
+         released.
+ 
+         Name: %{name}
+@@ -399,7 +399,7 @@ en:
+       box_add_short_not_found: |-
+         The box '%{name}' could not be found or
+         could not be accessed in the remote catalog. If this is a private
+-        box on HashiCorp's Atlas, please verify you're logged in via
++        box on HashiCorp's Vagrant Cloud, please verify you're logged in via
+         `vagrant login`. Also, please double-check the name. The expanded
+         URL and error message are shown below:
+ 
+@@ -564,12 +564,12 @@ en:
+ 
+         %{versions}
+       box_server_not_set: |-
+-        A URL to an Atlas server is not set, so boxes cannot be added with a
++        A URL to a Vagrant Cloud server is not set, so boxes cannot be added with a
+         shorthand ("mitchellh/precise64") format. You may also be seeing this
+         error if you meant to type in a path to a box file which doesn't exist
+         locally on your system.
+ 
+-        To set a URL to an Atlas server, set the `VAGRANT_SERVER_URL`
++        To set a URL to a Vagrant Cloud server, set the `VAGRANT_SERVER_URL`
+         environmental variable. Or, if you meant to use a file path, make sure
+         the path to the file is valid.
+       box_update_multi_provider: |-
+diff --git a/test/unit/plugins/commands/login/client_test.rb b/test/unit/plugins/commands/login/client_test.rb
+index d8d744e..86c53da 100644
+--- a/test/unit/plugins/commands/login/client_test.rb
++++ b/test/unit/plugins/commands/login/client_test.rb
+@@ -107,13 +107,13 @@ describe VagrantPlugins::LoginCommand::Client do
+     end
+ 
+     it "prefers the environment variable" do
+-      stub_env("ATLAS_TOKEN" => "ABCD1234")
++      stub_env("VAGRANT_CLOUD_TOKEN" => "ABCD1234")
+       subject.store_token("EFGH5678")
+       expect(subject.token).to eq("ABCD1234")
+     end
+ 
+     it "prints a warning if the envvar and stored file are both present" do
+-      stub_env("ATLAS_TOKEN" => "ABCD1234")
++      stub_env("VAGRANT_CLOUD_TOKEN" => "ABCD1234")
+       subject.store_token("EFGH5678")
+       expect(env.ui).to receive(:warn).with(/detected both/)
+       subject.token
diff --git a/debian/patches/series b/debian/patches/series
index 032764b..102bab3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 0005-Support-system-installed-plugins.patch
 0006-Relax-dependency-resolution.patch
 0007-Update-command.rb.patch
+0008-Convert-atlas-references-to-vagrant-cloud.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to