vagrant/plugins/guests/fedora/cap/flavor.rb

24 lines
538 B
Ruby
Raw Normal View History

module VagrantPlugins
module GuestFedora
module Cap
class Flavor
def self.flavor(machine)
# Read the version file
version = nil
machine.communicate.sudo("grep VERSION_ID /etc/os-release") do |type, data|
if type == :stdout
version = data.split("=")[1].chomp.to_i
end
end
2015-06-01 01:58:38 +00:00
if version.nil?
return :fedora
else
return "fedora_#{version}".to_sym
end
end
end
end
end
end