Class: OctocatalogDiff::Util::Catalogs
- Inherits:
-
Object
- Object
- OctocatalogDiff::Util::Catalogs
- Defined in:
- lib/octocatalog-diff/util/catalogs.rb
Overview
Helper class to construct catalogs, performing all necessary steps such as bootstrapping directories, installing facts, and running puppet.
Instance Method Summary collapse
-
#bootstrap_then_exit ⇒ Object
Handles the “bootstrap then exit” option, which bootstraps directories but exits without compiling catalogs.
-
#catalogs ⇒ Hash
Compile catalogs.
-
#initialize(options, logger) ⇒ Catalogs
constructor
Constructor.
Constructor Details
#initialize(options, logger) ⇒ Catalogs
Constructor
18 19 20 21 22 23 |
# File 'lib/octocatalog-diff/util/catalogs.rb', line 18 def initialize(, logger) @options = @logger = logger @catalogs = nil raise '@logger must not be nil' if @logger.nil? end |
Instance Method Details
#bootstrap_then_exit ⇒ Object
Handles the “bootstrap then exit” option, which bootstraps directories but exits without compiling catalogs.
34 35 36 37 38 39 |
# File 'lib/octocatalog-diff/util/catalogs.rb', line 34 def bootstrap_then_exit @logger.debug('Begin bootstrap_then_exit') OctocatalogDiff::CatalogUtil::Bootstrap.bootstrap_directory_parallelizer(@options, @logger) @logger.debug('Success bootstrap_then_exit') @logger.info('Successfully completed --bootstrap-then-exit action') end |
#catalogs ⇒ Hash
Compile catalogs. This handles building both the old and new catalog (in parallel) and returns only when both catalogs have been built.
28 29 30 |
# File 'lib/octocatalog-diff/util/catalogs.rb', line 28 def catalogs @catalogs ||= build_catalog_parallelizer end |