Module: Bosh::Stemcell::OperatingSystem

Defined in:
lib/bosh/stemcell/operating_system.rb

Defined Under Namespace

Classes: Base, Centos, Photonos, Rhel, Ubuntu

Class Method Summary collapse

Class Method Details

.for(operating_system_name, operating_system_version = nil) ⇒ Object


4
5
6
7
8
9
10
11
12
# File 'lib/bosh/stemcell/operating_system.rb', line 4

def self.for(operating_system_name, operating_system_version = nil)
  case operating_system_name
    when 'centos' then Centos.new(operating_system_version)
    when 'rhel' then Rhel.new(operating_system_version)
    when 'ubuntu' then Ubuntu.new(operating_system_version)
    when 'photonos' then Photonos.new(operating_system_version)
    else raise ArgumentError.new("invalid operating system: #{operating_system_name}")
  end
end