vagrant/plugins/hosts/suse/host.rb

30 lines
650 B
Ruby
Raw Normal View History

2012-04-19 05:20:45 +00:00
require "pathname"
2012-05-23 23:03:14 +00:00
require "vagrant"
2012-04-19 05:20:45 +00:00
module VagrantPlugins
module HostSUSE
2014-01-08 05:11:59 +00:00
class Host < Vagrant.plugin("2", :host)
2014-01-08 05:18:36 +00:00
def detect?(env)
old_release_file = Pathname.new("/etc/SuSE-release")
if old_release_file.exist?
old_release_file.open("r") do |f|
return true if f.gets =~ /^(openSUSE|SUSE Linux Enterprise)/
end
end
new_release_file = Pathname.new("/etc/os-release")
if new_release_file.exist?
new_release_file.open("r") do |f|
return true if f.gets =~ /(openSUSE|SLES)/
end
end
false
end
end
end
end