# File lib/puppet/configurer.rb, line 87
 87:   def retrieve_catalog
 88:     if Puppet::Resource::Catalog.indirection.terminus_class == :rest
 89:       # This is a bit complicated.  We need the serialized and escaped facts,
 90:       # and we need to know which format they're encoded in.  Thus, we
 91:       # get a hash with both of these pieces of information.
 92:       fact_options = facts_for_uploading
 93:     else
 94:       fact_options = {}
 95:     end
 96: 
 97:     # First try it with no cache, then with the cache.
 98:     unless (Puppet[:use_cached_catalog] and result = retrieve_catalog_from_cache(fact_options)) or result = retrieve_new_catalog(fact_options)
 99:       if ! Puppet[:usecacheonfailure]
100:         Puppet.warning "Not using cache on failed catalog"
101:         return nil
102:       end
103:       result = retrieve_catalog_from_cache(fact_options)
104:     end
105: 
106:     return nil unless result
107: 
108:     convert_catalog(result, @duration)
109:   end