Class: Bosh::Stemcell::Aws::LightStemcell
- Inherits:
-
Object
- Object
- Bosh::Stemcell::Aws::LightStemcell
- Defined in:
- lib/bosh/stemcell/aws/light_stemcell.rb
Instance Method Summary collapse
-
#initialize(stemcell, virtualization_type, regions = Region::REGIONS) ⇒ LightStemcell
constructor
A new instance of LightStemcell.
- #path ⇒ Object
- #write_archive ⇒ Object
Constructor Details
#initialize(stemcell, virtualization_type, regions = Region::REGIONS) ⇒ LightStemcell
Returns a new instance of LightStemcell.
11 12 13 14 15 |
# File 'lib/bosh/stemcell/aws/light_stemcell.rb', line 11 def initialize(stemcell, virtualization_type, regions=Region::REGIONS) @stemcell = stemcell @virtualization_type = virtualization_type @regions = regions end |
Instance Method Details
#path ⇒ Object
27 28 29 30 |
# File 'lib/bosh/stemcell/aws/light_stemcell.rb', line 27 def path stemcell_name = adjust_hvm_name(File.basename(@stemcell.path)) File.join(File.dirname(@stemcell.path), "light-#{stemcell_name}") end |
#write_archive ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/bosh/stemcell/aws/light_stemcell.rb', line 17 def write_archive @stemcell.extract(exclude: 'image') do |extracted_stemcell_dir| Dir.chdir(extracted_stemcell_dir) do FileUtils.touch('image', verbose: true) File.write('stemcell.MF', Psych.dump(manifest)) Rake::FileUtilsExt.sh("sudo tar cvzf #{path} *") end end end |