Class: Bosh::Director::Jobs::Helpers::NameVersionReleaseDeleter

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/jobs/helpers/name_version_release_deleter.rb

Instance Method Summary collapse

Constructor Details

#initialize(release_deleter, release_manager, release_version_deleter, logger) ⇒ NameVersionReleaseDeleter

Returns a new instance of NameVersionReleaseDeleter.



4
5
6
7
8
9
# File 'lib/bosh/director/jobs/helpers/name_version_release_deleter.rb', line 4

def initialize(release_deleter, release_manager, release_version_deleter, logger)
  @release_deleter = release_deleter
  @release_manager = release_manager
  @release_version_deleter = release_version_deleter
  @logger = logger
end

Instance Method Details

#find_and_delete_release(name, version, force) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bosh/director/jobs/helpers/name_version_release_deleter.rb', line 11

def find_and_delete_release(name, version, force)
  @logger.info("Looking up release: #{name}")
  release = @release_manager.find_by_name(name)
  @logger.info("Found release: #{release.name}")

  if version
    delete_release_version(release, version, force)
  else
    delete_entire_release(release, force)
  end
end