lib/bosh/stemcell/builder_options.rb in bosh-stemcell-1.5.0.pre.1210 vs lib/bosh/stemcell/builder_options.rb in bosh-stemcell-1.5.0.pre.1211
- old
+ new
@@ -6,19 +6,23 @@
class BuilderOptions
def initialize(env, options)
@environment = env
@infrastructure = options.fetch(:infrastructure)
@operating_system = options.fetch(:operating_system)
+ @agent_name = options.fetch(:agent_name)
@stemcell_version = options.fetch(:stemcell_version)
@image_create_disk_size = options.fetch(:disk_size, infrastructure.default_disk_size)
@bosh_micro_release_tgz_path = options.fetch(:tarball)
end
def default
+ stemcell_name = "bosh-#{infrastructure.name}-#{infrastructure.hypervisor}-#{operating_system.name}"
+ stemcell_name += "-#{agent_name}_agent" unless agent_name == 'ruby'
+
{
- 'stemcell_name' => "bosh-#{infrastructure.name}-#{infrastructure.hypervisor}-#{operating_system.name}",
+ 'stemcell_name' => stemcell_name,
'stemcell_tgz' => archive_filename.to_s,
'stemcell_image_name' => stemcell_image_name,
'stemcell_version' => stemcell_version,
'stemcell_hypervisor' => infrastructure.hypervisor,
'stemcell_infrastructure' => infrastructure.name,
@@ -36,10 +40,11 @@
attr_reader(
:environment,
:infrastructure,
:operating_system,
+ :agent_name,
:stemcell_version,
:image_create_disk_size,
:bosh_micro_release_tgz_path
)
@@ -66,10 +71,10 @@
'bosh_micro_release_tgz_path' => bosh_micro_release_tgz_path,
}
end
def archive_filename
- ArchiveFilename.new(stemcell_version, infrastructure, operating_system, 'bosh-stemcell', false)
+ ArchiveFilename.new(stemcell_version, infrastructure, operating_system, 'bosh-stemcell', false, agent_name)
end
def stemcell_image_name
"#{infrastructure.name}-#{infrastructure.hypervisor}-#{operating_system.name}.raw"
end