diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index f89c94773..106d0d9c5 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -545,21 +545,21 @@ module Vagrant def push(name=nil) @logger.info("Getting push: #{name}") - if vagrantfile.pushes.nil? || vagrantfile.pushes.empty? + if pushes.nil? || pushes.empty? raise Vagrant::Errors::PushesNotDefined end if name.nil? - if vagrantfile.pushes.length != 1 + if pushes.length != 1 raise Vagrant::Errors::PushStrategyNotProvided, - pushes: vagrantfile.pushes + pushes: pushes end - name = vagrantfile.pushes.first + name = pushes.first else - if !vagrantfile.pushes.include?(name.to_sym) + if !pushes.include?(name.to_sym) raise Vagrant::Errors::PushStrategyNotDefined, name: name, - pushes: vagrantfile.pushes + pushes: pushes end end @@ -584,6 +584,13 @@ module Vagrant end end + # The list of pushes defined in this Vagrantfile. + # + # @return [Array] + def pushes + vagrantfile.pushes + end + # This returns a machine with the proper provider for this environment. # The machine named by `name` must be in this environment. #