Fix syntax errors and style on Fedora flavor cap

This commit is contained in:
Seth Vargo 2015-05-31 18:56:13 -07:00
parent efd7b459dd
commit 3fcd3d691a
1 changed files with 7 additions and 8 deletions

View File

@ -4,19 +4,18 @@ module VagrantPlugins
class Flavor class Flavor
def self.flavor(machine) def self.flavor(machine)
# Read the version file # Read the version file
output = "" version = nil
machine.communicate.sudo("grep VERSION_ID /etc/os-release") do |type, data| machine.communicate.sudo("grep VERSION_ID /etc/os-release") do |type, data|
output += data if type == :stdout if type == :stdout
version = data.split("=")[1].chomp.to_i
end
end end
version = output.split("=")[1].chomp!.to_i
# Detect various flavors we care about # Detect various flavors we care about
if version >= 20 if version.nil? || version < 20
return :"fedora_#{version}"
else if version >= 20
return :"fedora_#{version}"
else
return :fedora return :fedora
else
return "fedora_#{version}".to_sym
end end
end end
end end