Class: Actions::Katello::RepositorySet::DisableRepository

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/katello/repository_set/disable_repository.rb

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



5
6
7
# File 'app/lib/actions/katello/repository_set/disable_repository.rb', line 5

def humanized_name
  _("Disable")
end

#plan(product, content, options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/lib/actions/katello/repository_set/disable_repository.rb', line 9

def plan(product, content, options)
  if options[:repository_id]
    repository = ::Katello::Repository.find(options[:repository_id])
  else
    repository = repository_mapper(product,
                                   content,
                                   options).find_repository
  end

  if repository
    action_subject(repository)
    plan_action(Repository::Destroy, repository)
  else
    fail ::Katello::Errors::NotFound, _('Repository not found')
  end
end