Class: Bosh::Director::Jobs::Helpers::CompiledPackageDeleter
- Defined in:
- lib/bosh/director/jobs/helpers/compiled_package_deleter.rb
Instance Method Summary collapse
- #delete(compiled_package, options = {}) ⇒ Object
-
#initialize(blob_deleter, logger) ⇒ CompiledPackageDeleter
constructor
A new instance of CompiledPackageDeleter.
Constructor Details
#initialize(blob_deleter, logger) ⇒ CompiledPackageDeleter
Returns a new instance of CompiledPackageDeleter.
4 5 6 7 |
# File 'lib/bosh/director/jobs/helpers/compiled_package_deleter.rb', line 4 def initialize(blob_deleter, logger) @blob_deleter = blob_deleter @logger = logger end |
Instance Method Details
#delete(compiled_package, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bosh/director/jobs/helpers/compiled_package_deleter.rb', line 9 def delete(compiled_package, = {}) package = compiled_package.package @logger.info('Deleting compiled package: ' + "#{package.name}/#{package.version}" + "for #{compiled_package.stemcell_os}/#{compiled_package.stemcell_version}") errors = [] if @blob_deleter.delete(compiled_package.blobstore_id, errors, ['force']) compiled_package.destroy end errors end |