From ca6cc140ff644de8c469c7d1a6c6f5b9d7cc5b26 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 17 Dec 2018 14:41:29 -0800 Subject: [PATCH 1/2] Catch InvalidVersion errors from vagrant_cloud client This commit adds a new rescue to the `publish` command for when the client detects an invalid version prior to making the API request to create that version. --- plugins/commands/cloud/publish.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/commands/cloud/publish.rb b/plugins/commands/cloud/publish.rb index 3f6000d31..346170e38 100644 --- a/plugins/commands/cloud/publish.rb +++ b/plugins/commands/cloud/publish.rb @@ -127,6 +127,10 @@ module VagrantPlugins @env.ui.error(e) return 1 end + rescue VagrantCloud::InvalidVersion => e + @env.ui.error(I18n.t("cloud_command.errors.publish.fail", org: org, box_name: box_name)) + @env.ui.error(e) + return 1 end begin From eaad94635c639ba9bc413e664d21630b08a1c73b Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 17 Dec 2018 14:42:12 -0800 Subject: [PATCH 2/2] Update vagrant_cloud dep for Vagrant This commit moves up the vagrant_cloud dependency to take advantage of the new error VagrantCloud::InvalidVersion for the publish command --- vagrant.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant.gemspec b/vagrant.gemspec index 7ff8dca95..8c5630098 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |s| s.add_dependency "winrm", "~> 2.1" s.add_dependency "winrm-fs", "~> 1.0" s.add_dependency "winrm-elevated", "~> 1.1" - s.add_dependency "vagrant_cloud", "~> 2.0.0" + s.add_dependency "vagrant_cloud", "~> 2.0.2" # NOTE: The ruby_dep gem is an implicit dependency from the listen gem. Later versions # of the ruby_dep gem impose an aggressive constraint on the required ruby version (>= 2.2.5).