From 3f5d45815819f2df980284163231b017a9814e42 Mon Sep 17 00:00:00 2001 From: lkuntar Date: Thu, 13 Apr 2017 15:22:24 +0200 Subject: [PATCH 1/5] Rake tests failed because of deprecated function --- Gemfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index 3774bec..3d26ef7 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,11 @@ source "https://rubygems.org" gemspec +# This is a restriction to avoid an error "undefined method 'last_comment'" which is deprecated +# https://github.com/ruby/rake/issues/116 +# Remove it after update rspec-core-2.99.2 to version greater than 3.4.4 +gem 'rake', '< 11' + group :development do # We depend on Vagrant for development, but we don't add it as a # gem dependency because we expect to be installed within the From ce5e9c92370ab7bc55145e3aa38bc8feb21e1d64 Mon Sep 17 00:00:00 2001 From: Leila-Kuntar Date: Fri, 28 Apr 2017 17:13:36 +0200 Subject: [PATCH 2/5] Allow subnetworks --- lib/vagrant-google/action/run_instance.rb | 5 ++++- lib/vagrant-google/config.rb | 9 +++++++++ vagrant-google.gemspec | 5 +++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/vagrant-google/action/run_instance.rb b/lib/vagrant-google/action/run_instance.rb index a9fb190..39b9035 100644 --- a/lib/vagrant-google/action/run_instance.rb +++ b/lib/vagrant-google/action/run_instance.rb @@ -50,6 +50,7 @@ def call(env) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize disk_name = zone_config.disk_name disk_type = zone_config.disk_type network = zone_config.network + subnetwork = zone_config.subnetwork metadata = zone_config.metadata tags = zone_config.tags can_ip_forward = zone_config.can_ip_forward @@ -60,7 +61,7 @@ def call(env) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize on_host_maintenance = zone_config.on_host_maintenance autodelete_disk = zone_config.autodelete_disk service_accounts = zone_config.service_accounts - + # Launch! env[:ui].info(I18n.t("vagrant_google.launching_instance")) env[:ui].info(" -- Name: #{name}") @@ -72,6 +73,7 @@ def call(env) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize env[:ui].info(" -- Instance Group: #{instance_group}") env[:ui].info(" -- Zone: #{zone}") if zone env[:ui].info(" -- Network: #{network}") if network + env[:ui].info(" -- Subnetwork: #{subnetwork}") if subnetwork env[:ui].info(" -- Metadata: '#{metadata}'") env[:ui].info(" -- Tags: '#{tags}'") env[:ui].info(" -- IP Forward: #{can_ip_forward}") @@ -126,6 +128,7 @@ def call(env) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize :disk_type => disk_type, :image => image, :network => network, + :subnetwork => subnetwork, :metadata => metadata, :tags => tags, :can_ip_forward => can_ip_forward, diff --git a/lib/vagrant-google/config.rb b/lib/vagrant-google/config.rb index c18e1aa..9424c26 100644 --- a/lib/vagrant-google/config.rb +++ b/lib/vagrant-google/config.rb @@ -82,6 +82,11 @@ class Config < Vagrant.plugin("2", :config) # rubocop:disable Metrics/ClassLengt # @return [String] attr_accessor :network + # The name of the subnetwork + # + # @return [String] + attr_accessor :subnetwork + # Tags to apply to the instance # # @return [Array] @@ -159,6 +164,7 @@ def initialize(zone_specific=false) @metadata = {} @name = UNSET_VALUE @network = UNSET_VALUE + @subnetwork = UNSET_VALUE @tags = [] @can_ip_forward = UNSET_VALUE @external_ip = UNSET_VALUE @@ -275,6 +281,9 @@ def finalize! # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedC # Network defaults to 'default' @network = "default" if @network == UNSET_VALUE + # Subnetwork defaults to nil + @subnetwork = nil if @subnetwork == UNSET_VALUE + # Default zone is us-central1-f. @zone = "us-central1-f" if @zone == UNSET_VALUE diff --git a/vagrant-google.gemspec b/vagrant-google.gemspec index 6481636..30e5897 100644 --- a/vagrant-google.gemspec +++ b/vagrant-google.gemspec @@ -15,6 +15,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__) require "vagrant-google/version" + Gem::Specification.new do |s| s.name = "vagrant-google" s.version = VagrantPlugins::Google::VERSION @@ -28,8 +29,8 @@ Gem::Specification.new do |s| s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "vagrant-google" - s.add_runtime_dependency "fog-google", "~> 0.4.0" - s.add_runtime_dependency "google-api-client", "< 0.9", ">= 0.6.2" + s.add_runtime_dependency "fog-google", "~> 0.5.2" + s.add_runtime_dependency "google-api-client", "< 0.9", "> 0.8.5" s.add_development_dependency "pry" s.add_development_dependency "pry-byebug" From c834069b27412e6e28631a2c368aeeaef6f0a89a Mon Sep 17 00:00:00 2001 From: Leila-Kuntar Date: Fri, 28 Apr 2017 17:27:27 +0200 Subject: [PATCH 3/5] after rubocop run --- Gemfile | 4 ++-- lib/vagrant-google/action/run_instance.rb | 2 +- vagrant-google.gemspec | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 3d26ef7..eeffcb3 100644 --- a/Gemfile +++ b/Gemfile @@ -18,8 +18,8 @@ gemspec # This is a restriction to avoid an error "undefined method 'last_comment'" which is deprecated # https://github.com/ruby/rake/issues/116 -# Remove it after update rspec-core-2.99.2 to version greater than 3.4.4 -gem 'rake', '< 11' +# Remove it after update rspec-core-2.99.2 to version greater or equal to 3.4.4 +gem 'rake', '< 11' group :development do # We depend on Vagrant for development, but we don't add it as a diff --git a/lib/vagrant-google/action/run_instance.rb b/lib/vagrant-google/action/run_instance.rb index 39b9035..1e823bc 100644 --- a/lib/vagrant-google/action/run_instance.rb +++ b/lib/vagrant-google/action/run_instance.rb @@ -61,7 +61,7 @@ def call(env) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize on_host_maintenance = zone_config.on_host_maintenance autodelete_disk = zone_config.autodelete_disk service_accounts = zone_config.service_accounts - + # Launch! env[:ui].info(I18n.t("vagrant_google.launching_instance")) env[:ui].info(" -- Name: #{name}") diff --git a/vagrant-google.gemspec b/vagrant-google.gemspec index 30e5897..1699b2c 100644 --- a/vagrant-google.gemspec +++ b/vagrant-google.gemspec @@ -15,7 +15,6 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__) require "vagrant-google/version" - Gem::Specification.new do |s| s.name = "vagrant-google" s.version = VagrantPlugins::Google::VERSION From 55ce51c27d95c88d39cade263dd5569d24093ec1 Mon Sep 17 00:00:00 2001 From: Leila Kuntar Date: Fri, 19 May 2017 17:47:06 +0200 Subject: [PATCH 4/5] Update Gemfile Gemfile is updated in other pull request --- Gemfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Gemfile b/Gemfile index eeffcb3..3774bec 100644 --- a/Gemfile +++ b/Gemfile @@ -16,11 +16,6 @@ source "https://rubygems.org" gemspec -# This is a restriction to avoid an error "undefined method 'last_comment'" which is deprecated -# https://github.com/ruby/rake/issues/116 -# Remove it after update rspec-core-2.99.2 to version greater or equal to 3.4.4 -gem 'rake', '< 11' - group :development do # We depend on Vagrant for development, but we don't add it as a # gem dependency because we expect to be installed within the From 7b9767ee34be0f6cc8975025b879acc1fbd4e831 Mon Sep 17 00:00:00 2001 From: Wyosotis Date: Tue, 6 Jun 2017 14:10:52 +0200 Subject: [PATCH 5/5] update varsion of fog-google --- vagrant-google.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant-google.gemspec b/vagrant-google.gemspec index 1699b2c..138cb20 100644 --- a/vagrant-google.gemspec +++ b/vagrant-google.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "vagrant-google" - s.add_runtime_dependency "fog-google", "~> 0.5.2" + s.add_runtime_dependency "fog-google", "~> 0.5.3" s.add_runtime_dependency "google-api-client", "< 0.9", "> 0.8.5" s.add_development_dependency "pry"