diff --git a/lib/puppet/catalog-diff/compilecatalog.rb b/lib/puppet/catalog-diff/compilecatalog.rb index 8d8f29c..16ce9ba 100644 --- a/lib/puppet/catalog-diff/compilecatalog.rb +++ b/lib/puppet/catalog-diff/compilecatalog.rb @@ -34,7 +34,8 @@ def lookup_environment(node_name) end def compile_catalog(node_name,server) - environment = lookup_environment(node_name) + server,environment = server.split('/') + environment ||= lookup_environment(node_name) endpoint = "/#{environment}/catalog/#{node_name}" Puppet.debug("Connecting to server: #{server}") begin diff --git a/lib/puppet/catalog-diff/searchfacts.rb b/lib/puppet/catalog-diff/searchfacts.rb index 70b55d7..c11b114 100644 --- a/lib/puppet/catalog-diff/searchfacts.rb +++ b/lib/puppet/catalog-diff/searchfacts.rb @@ -15,7 +15,7 @@ def find_nodes(options = {}) if options[:use_puppetdb] active_nodes = find_nodes_puppetdb() else - active_nodes = find_nodes_rest(options[:old_server]) + active_nodes = find_nodes_rest(options[:old_server].split('/')[0]) end if active_nodes.empty? raise "No active nodes were returned from your fact search" diff --git a/lib/puppet/face/catalog/diff.rb b/lib/puppet/face/catalog/diff.rb index 64939bc..b7f34db 100644 --- a/lib/puppet/face/catalog/diff.rb +++ b/lib/puppet/face/catalog/diff.rb @@ -119,8 +119,8 @@ else # User passed use two hostnames - old_catalogs = Dir.mktmpdir("#{catalog1}-") - new_catalogs = Dir.mktmpdir("#{catalog2}-") + old_catalogs = Dir.mktmpdir("#{catalog1.gsub('/', '_')}-") + new_catalogs = Dir.mktmpdir("#{catalog2.gsub('/', '_')}-") pull_output = Puppet::Face[:catalog, '0.0.1'].pull(old_catalogs,new_catalogs,options[:fact_search],:old_server => catalog1,:new_server => catalog2,:changed_depth => options[:changed_depth], :threads => options[:threads]) diff_output = Puppet::Face[:catalog, '0.0.1'].diff(old_catalogs,new_catalogs,options) nodes = diff_output