From 7c1fcbdde045d0fedef1dca6697d7e487c5dfd59 Mon Sep 17 00:00:00 2001 From: Achim Herwig Date: Tue, 28 Feb 2012 11:55:39 +0100 Subject: [PATCH] Added openSuSE as host system. Init script for NFS-server differs. --- lib/vagrant.rb | 1 + lib/vagrant/hosts.rb | 1 + lib/vagrant/hosts/opensuse.rb | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 lib/vagrant/hosts/opensuse.rb diff --git a/lib/vagrant.rb b/lib/vagrant.rb index 39afea00a..e607e7d24 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -165,6 +165,7 @@ Vagrant.config_keys.register(:package) { Vagrant::Config::PackageConfig } Vagrant.hosts.register(:arch) { Vagrant::Hosts::Arch } Vagrant.hosts.register(:bsd) { Vagrant::Hosts::BSD } Vagrant.hosts.register(:fedora) { Vagrant::Hosts::Fedora } +Vagrant.hosts.register(:opensuse) { Vagrant::Hosts::OpenSUSE } Vagrant.hosts.register(:freebsd) { Vagrant::Hosts::FreeBSD } Vagrant.hosts.register(:gentoo) { Vagrant::Hosts::Gentoo } Vagrant.hosts.register(:linux) { Vagrant::Hosts::Linux } diff --git a/lib/vagrant/hosts.rb b/lib/vagrant/hosts.rb index 22d2aa4d2..019c91d95 100644 --- a/lib/vagrant/hosts.rb +++ b/lib/vagrant/hosts.rb @@ -7,6 +7,7 @@ module Vagrant autoload :BSD, 'vagrant/hosts/bsd' autoload :FreeBSD, 'vagrant/hosts/freebsd' autoload :Fedora, 'vagrant/hosts/fedora' + autoload :OpenSUSE, 'vagrant/hosts/opensuse' autoload :Gentoo, 'vagrant/hosts/gentoo' autoload :Linux, 'vagrant/hosts/linux' autoload :Windows, 'vagrant/hosts/windows' diff --git a/lib/vagrant/hosts/opensuse.rb b/lib/vagrant/hosts/opensuse.rb new file mode 100644 index 000000000..27ab73eac --- /dev/null +++ b/lib/vagrant/hosts/opensuse.rb @@ -0,0 +1,30 @@ +require 'pathname' + +module Vagrant + module Hosts + class OpenSUSE < Linux + def self.match? + release_file = Pathname.new("/etc/SuSE-release") + + if release_file.exist? + release_file.open("r") do |f| + return true if f.gets =~ /^openSUSE/ + end + end + + false + end + + # Normal, mid-range precedence. + def self.precedence + 5 + end + + def initialize(*args) + super + + @nfs_server_binary = "/etc/init.d/nfsserver" + end + end + end +end