2014-10-30 19:36:06 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestFedora
|
|
|
|
module Cap
|
|
|
|
class Flavor
|
|
|
|
def self.flavor(machine)
|
|
|
|
# Read the version file
|
2015-06-01 01:56:13 +00:00
|
|
|
version = nil
|
2014-10-30 19:36:06 +00:00
|
|
|
machine.communicate.sudo("grep VERSION_ID /etc/os-release") do |type, data|
|
2015-06-01 01:56:13 +00:00
|
|
|
if type == :stdout
|
|
|
|
version = data.split("=")[1].chomp.to_i
|
|
|
|
end
|
2014-10-30 19:36:06 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Detect various flavors we care about
|
2015-06-01 01:56:13 +00:00
|
|
|
if version.nil? || version < 20
|
2014-10-30 19:36:06 +00:00
|
|
|
return :fedora
|
2015-06-01 01:56:13 +00:00
|
|
|
else
|
|
|
|
return "fedora_#{version}".to_sym
|
2014-10-30 19:36:06 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|