Class: Katello::Pulp3::ContentGuard

Inherits:
Model
  • Object
show all
Defined in:
app/models/katello/pulp3/content_guard.rb

Class Method Summary collapse

Methods inherited from Model

#destroy!

Class Method Details

.import(smart_proxy = SmartProxy.pulp_primary!, force = false) ⇒ Object



4
5
6
7
8
9
10
11
# File 'app/models/katello/pulp3/content_guard.rb', line 4

def self.import(smart_proxy = SmartProxy.pulp_primary!, force = false)
  return unless (count == 0 || force)
  content_guard_api = Katello::Pulp3::Api::ContentGuard.new(smart_proxy)
  content_guard = content_guard_api.list&.results&.first
  return unless content_guard
  katello_content_guard = self.new(name: content_guard.name, pulp_href: content_guard.pulp_href)
  katello_content_guard.save!
end