From 178c47992cf613d2b4e40f148073fcd5619893cd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 23 Dec 2012 16:19:12 -0800 Subject: [PATCH] Remove unused files --- plugins/kernel_v1/config/vm.rb | 3 -- plugins/kernel_v1/config/vm_provisioner.rb | 60 ---------------------- plugins/kernel_v1/config/vm_subvm.rb | 26 ---------- 3 files changed, 89 deletions(-) delete mode 100644 plugins/kernel_v1/config/vm_provisioner.rb delete mode 100644 plugins/kernel_v1/config/vm_subvm.rb diff --git a/plugins/kernel_v1/config/vm.rb b/plugins/kernel_v1/config/vm.rb index ab18dd382..98e502d1a 100644 --- a/plugins/kernel_v1/config/vm.rb +++ b/plugins/kernel_v1/config/vm.rb @@ -2,9 +2,6 @@ require "pathname" require "vagrant" -require File.expand_path("../vm_provisioner", __FILE__) -require File.expand_path("../vm_subvm", __FILE__) - module VagrantPlugins module Kernel_V1 # This is the Version 1.0.x Vagrant VM configuration. This is diff --git a/plugins/kernel_v1/config/vm_provisioner.rb b/plugins/kernel_v1/config/vm_provisioner.rb deleted file mode 100644 index b42d03a7e..000000000 --- a/plugins/kernel_v1/config/vm_provisioner.rb +++ /dev/null @@ -1,60 +0,0 @@ -require 'log4r' - -module VagrantPlugins - module Kernel_V1 - # Represents a single configured provisioner for a VM. - class VagrantConfigProvisioner - attr_reader :shortcut - attr_reader :provisioner - attr_reader :config - - def initialize(shortcut, options=nil, &block) - @logger = Log4r::Logger.new("vagrant::config::vm::provisioner") - @logger.debug("Provisioner config: #{shortcut}") - @shortcut = shortcut - @provisioner = shortcut - @config = nil - - # If the shorcut is a symbol, we look through the registered - # plugins to see if any define a provisioner we want. - if shortcut.is_a?(Symbol) - Vagrant.plugin("1").registered.each do |plugin| - if plugin.provisioner.has_key?(shortcut) - @provisioner = plugin.provisioner[shortcut] - break - end - end - end - - @logger.info("Provisioner class: #{provisioner}") - configure(options, &block) if @provisioner - end - - # Configures the provisioner if it can (if it is valid). - def configure(options=nil, &block) - config_class = @provisioner.config_class - return if !config_class - - @logger.debug("Configuring provisioner with: #{config_class}") - @config = config_class.new - @config.set_options(options) if options - block.call(@config) if block - end - - def validate(env, errors) - if !provisioner - # If we don't have a provisioner then the whole thing is invalid. - errors.add(I18n.t("vagrant.config.vm.provisioner_not_found", :shortcut => shortcut)) - return - end - - if !(provisioner <= Vagrant.plugin("1", :provisioner)) - errors.add(I18n.t("vagrant.config.vm.provisioner_invalid_class", :shortcut => shortcut)) - end - - # Pass on validation to the provisioner config - config.validate(env, errors) if config - end - end - end -end diff --git a/plugins/kernel_v1/config/vm_subvm.rb b/plugins/kernel_v1/config/vm_subvm.rb deleted file mode 100644 index 451da5dcb..000000000 --- a/plugins/kernel_v1/config/vm_subvm.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "vagrant/util/stacked_proc_runner" - -module VagrantPlugins - module Kernel_V1 - # Represents a single sub-VM in a multi-VM environment. - class VagrantConfigSubVM - include Vagrant::Util::StackedProcRunner - - attr_reader :options - - def initialize - @options = {} - end - - # This returns an array of the procs to configure this VM, with - # the proper version pre-pended for the configuration loader. - # - # @return [Array] - def config_procs - proc_stack.map do |proc| - ["1", proc] - end - end - end - end -end