Fix syntax errors and style on Fedora flavor cap
This commit is contained in:
parent
efd7b459dd
commit
3fcd3d691a
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue