Class: Content::Repository

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Orchestration::Pulp::Sync, Foreman::STI
Defined in:
app/models/content/repository.rb

Direct Known Subclasses

OperatingSystem, Product

Defined Under Namespace

Classes: OperatingSystem, Product

Constant Summary collapse

YUM_TYPE =
'yum'
KICKSTART_TYPE =
'kickstart'
FILE_TYPE =
'iso'
TYPES =
[YUM_TYPE, KICKSTART_TYPE, FILE_TYPE]

Instance Method Summary collapse

Instance Method Details

#content_typesObject



36
37
38
# File 'app/models/content/repository.rb', line 36

def content_types
  TYPES
end

#entity_nameObject

inhariters are expected to override this method



46
47
48
# File 'app/models/content/repository.rb', line 46

def entity_name
  ''
end

#publish(content_view) ⇒ Object



50
51
52
53
54
55
56
# File 'app/models/content/repository.rb', line 50

def publish content_view
  repository_clones.create!(
    :content_views => [content_view],
    :name => self.name + "_clone",
    :relative_path => "content_views/#{to_label}/#{Foreman.uuid}"
  )
end

#to_labelObject

The label is used as a repository label in a yum repo file.



41
42
43
# File 'app/models/content/repository.rb', line 41

def to_label
  "#{entity_name}-#{name}".parameterize
end