Class: Actions::Pulp3::Orchestration::Repository::Delete

Inherits:
Abstract
  • Object
show all
Defined in:
app/lib/actions/pulp3/orchestration/repository/delete.rb

Instance Method Summary collapse

Methods inherited from Abstract

#smart_proxy

Instance Method Details

#plan(repository, smart_proxy) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/lib/actions/pulp3/orchestration/repository/delete.rb', line 6

def plan(repository, smart_proxy)
  sequence do
    plan_action(Actions::Pulp3::Repository::DeleteRemote, repository.id, smart_proxy) if repository.remote_href
    plan_action(Actions::Pulp3::Repository::DeleteDistributions, repository.id, smart_proxy)

    if repository.content_view.default?
      #we're deleting the library instance, so just delete the whole pulp3 repo
      plan_action(Actions::Pulp3::Repository::Delete, repository.id, smart_proxy)
    elsif repository.environment.nil?
      #we're deleting the archived instance, so delete the version
      plan_action(Actions::Pulp3::Repository::DeleteVersion, repository, smart_proxy)
    end
  end
end