From e9f6c81ab7c647d4210f76a92a933bc0768354c9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 7 Jan 2014 21:18:36 -0800 Subject: [PATCH] hosts/*: proper detect API --- lib/vagrant/plugin/v2/host.rb | 2 +- plugins/hosts/freebsd/host.rb | 2 +- plugins/hosts/gentoo/host.rb | 2 +- plugins/hosts/linux/host.rb | 2 +- plugins/hosts/opensuse/host.rb | 2 +- plugins/hosts/redhat/host.rb | 2 +- plugins/hosts/slackware/host.rb | 2 +- plugins/hosts/windows/host.rb | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/vagrant/plugin/v2/host.rb b/lib/vagrant/plugin/v2/host.rb index 33c96759b..3de202ed5 100644 --- a/lib/vagrant/plugin/v2/host.rb +++ b/lib/vagrant/plugin/v2/host.rb @@ -10,7 +10,7 @@ module Vagrant # matches the host class. # # @return [Boolean] - def detect? + def detect?(env) false end end diff --git a/plugins/hosts/freebsd/host.rb b/plugins/hosts/freebsd/host.rb index 7cb0502ec..21460a08e 100644 --- a/plugins/hosts/freebsd/host.rb +++ b/plugins/hosts/freebsd/host.rb @@ -4,7 +4,7 @@ require 'vagrant/util/platform' module VagrantPlugins module HostFreeBSD class Host < Vagrant.plugin("2", :host) - def self.detect?(env) + def detect?(env) Vagrant::Util::Platform.freebsd? end end diff --git a/plugins/hosts/gentoo/host.rb b/plugins/hosts/gentoo/host.rb index eaac10d77..ac7e019d0 100644 --- a/plugins/hosts/gentoo/host.rb +++ b/plugins/hosts/gentoo/host.rb @@ -3,7 +3,7 @@ require "vagrant" module VagrantPlugins module HostGentoo class Host < Vagrant.plugin("2", :host) - def self.detect?(env) + def detect?(env) File.exists?("/etc/gentoo-release") end end diff --git a/plugins/hosts/linux/host.rb b/plugins/hosts/linux/host.rb index d6352c684..334e62452 100644 --- a/plugins/hosts/linux/host.rb +++ b/plugins/hosts/linux/host.rb @@ -4,7 +4,7 @@ module VagrantPlugins module HostLinux # Represents a Linux based host, such as Ubuntu. class Host < Vagrant.plugin("2", :host) - def self.detect?(env) + def detect?(env) Vagrant::Util::Platform.linux? end end diff --git a/plugins/hosts/opensuse/host.rb b/plugins/hosts/opensuse/host.rb index 6333d75cc..5e0240d27 100644 --- a/plugins/hosts/opensuse/host.rb +++ b/plugins/hosts/opensuse/host.rb @@ -5,7 +5,7 @@ require "vagrant" module VagrantPlugins module HostOpenSUSE class Host < Vagrant.plugin("2", :host) - def self.detect?(env) + def detect?(env) release_file = Pathname.new("/etc/SuSE-release") if release_file.exist? diff --git a/plugins/hosts/redhat/host.rb b/plugins/hosts/redhat/host.rb index 70d21dc4d..325d81307 100644 --- a/plugins/hosts/redhat/host.rb +++ b/plugins/hosts/redhat/host.rb @@ -5,7 +5,7 @@ require "vagrant" module VagrantPlugins module HostRedHat class Host < Vagrant.plugin("2", :host) - def self.detect?(env) + def detect?(env) release_file = Pathname.new("/etc/redhat-release") if release_file.exist? diff --git a/plugins/hosts/slackware/host.rb b/plugins/hosts/slackware/host.rb index a5d430eb8..2afaff8f3 100644 --- a/plugins/hosts/slackware/host.rb +++ b/plugins/hosts/slackware/host.rb @@ -3,7 +3,7 @@ require "vagrant" module VagrantPlugins module HostSlackware class Host < Vagrant.plugin("2", :host) - def self.detect?(env) + def detect?(env) return File.exists?("/etc/slackware-release") || !Dir.glob("/usr/lib/setup/Plamo-*").empty? end diff --git a/plugins/hosts/windows/host.rb b/plugins/hosts/windows/host.rb index a7db5cfcc..4491f629a 100644 --- a/plugins/hosts/windows/host.rb +++ b/plugins/hosts/windows/host.rb @@ -5,7 +5,7 @@ require 'vagrant/util/platform' module VagrantPlugins module HostWindows class Host < Vagrant.plugin("2", :host) - def self.detect?(env) + def detect?(env) Vagrant::Util::Platform.windows? end end