Class: OctocatalogDiff::Catalog::PuppetMaster
- Inherits:
-
OctocatalogDiff::Catalog
- Object
- OctocatalogDiff::Catalog
- OctocatalogDiff::Catalog::PuppetMaster
- Defined in:
- lib/octocatalog-diff/catalog/puppetmaster.rb
Overview
Represents a Puppet catalog that is obtained by contacting the Puppet Master.
Constant Summary collapse
- DEFAULT_PUPPET_PORT_NUMBER =
Defaults
8140
- DEFAULT_PUPPET_SERVER_API =
3
- PUPPET_MASTER_TIMEOUT =
60
Instance Attribute Summary
Attributes inherited from OctocatalogDiff::Catalog
#built, #catalog, #catalog_json, #node, #options
Instance Method Summary collapse
-
#initialize(options) ⇒ PuppetMaster
constructor
Constructor.
Methods inherited from OctocatalogDiff::Catalog
#build, #builder, #compilation_dir, #compilation_dir=, #convert_file_resources, create, #environment, #error_message, #error_message=, #puppet_version, #resource, #resources, #retries, #valid?, #validate_references
Constructor Details
#initialize(options) ⇒ PuppetMaster
Constructor
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/octocatalog-diff/catalog/puppetmaster.rb', line 34 def initialize() super unless @options[:node].is_a?(String) && @options[:node] != '' raise ArgumentError, 'node must be a non-empty string' end unless @options[:branch].is_a?(String) && @options[:branch] != '' raise ArgumentError, 'Environment must be a non-empty string' end unless @options[:puppet_master].is_a?(String) && @options[:puppet_master] != '' raise ArgumentError, 'Puppet Master must be a non-empty string' end @timeout = .fetch(:puppet_master_timeout, .fetch(:timeout, PUPPET_MASTER_TIMEOUT)) @retry_failed_catalog = .fetch(:retry_failed_catalog, 0) @options[:puppet_master] += ":#{DEFAULT_PUPPET_PORT_NUMBER}" unless @options[:puppet_master] =~ /\:\d+$/ end |