class Bosh::Stemcell::Definition

Attributes

agent[R]
hypervisor_name[R]
infrastructure[R]
operating_system[R]

Public Class Methods

for( infrastructure_name, hypervisor_name, operating_system_name, operating_system_version, agent_name, light ) click to toggle source
# File lib/bosh/stemcell/definition.rb, line 9
def self.for(
  infrastructure_name,
  hypervisor_name,
  operating_system_name,
  operating_system_version,
  agent_name,
  light
)
  new(
    Bosh::Stemcell::Infrastructure.for(infrastructure_name),
    hypervisor_name,
    Bosh::Stemcell::OperatingSystem.for(operating_system_name, operating_system_version),
    Bosh::Stemcell::Agent.for(agent_name),
    light,
  )
end
new(infrastructure, hypervisor_name, operating_system, agent, light) click to toggle source
# File lib/bosh/stemcell/definition.rb, line 26
def initialize(infrastructure, hypervisor_name, operating_system, agent, light)
  @infrastructure = infrastructure
  @hypervisor_name = hypervisor_name
  @operating_system = operating_system
  @agent = agent
  @light = light
end

Public Instance Methods

==(other) click to toggle source
# File lib/bosh/stemcell/definition.rb, line 51
def ==(other)
  infrastructure == other.infrastructure &&
    operating_system == other.operating_system &&
    agent == other.agent &&
    light? == other.light?
end
disk_formats() click to toggle source
# File lib/bosh/stemcell/definition.rb, line 47
def disk_formats
  infrastructure.disk_formats
end
light?() click to toggle source
# File lib/bosh/stemcell/definition.rb, line 58
def light?
  @light == true
end
stemcell_name(disk_format) click to toggle source
# File lib/bosh/stemcell/definition.rb, line 34
def stemcell_name(disk_format)
  stemcell_name_parts = [
    infrastructure.name,
    hypervisor_name,
    operating_system.name,
  ]
  stemcell_name_parts << operating_system.version if operating_system.version
  stemcell_name_parts << "#{agent.name}_agent" unless agent.name == 'ruby'
  stemcell_name_parts << disk_format unless disk_format == infrastructure.default_disk_format

  stemcell_name_parts.join('-')
end