Class: OctocatalogDiff::API::V1::CatalogCompile
- Inherits:
-
Object
- Object
- OctocatalogDiff::API::V1::CatalogCompile
- Defined in:
- lib/octocatalog-diff/api/v1/catalog-compile.rb
Overview
This class allows octocatalog-diff to be used to compile catalogs.
Class Method Summary collapse
-
.catalog(options = nil) ⇒ OctocatalogDiff::Catalog
Public: Compile a catalog given the options provided.
Class Method Details
.catalog(options = nil) ⇒ OctocatalogDiff::Catalog
Public: Compile a catalog given the options provided.
Parameters are to be passed in a hash. Other catalog building parameters are also accepted
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/octocatalog-diff/api/v1/catalog-compile.rb', line 20 def self.catalog( = nil) # Validate the required options. unless .is_a?(Hash) raise ArgumentError, 'Usage: #catalog(options_hash)' end pass_opts, logger = OctocatalogDiff::API::V1::Common.() logger.debug "Compiling catalog for #{[:node]}" # Compile catalog catalog_opts = pass_opts.merge( from_catalog: '-', # Prevents a compile to_catalog: nil, # Forces a compile ) cat_obj = OctocatalogDiff::Util::Catalogs.new(catalog_opts, logger) OctocatalogDiff::API::V1::Catalog.new(cat_obj.catalogs[:to]) end |