lib/bolt/target.rb in bolt-1.1.0 vs lib/bolt/target.rb in bolt-1.2.0
- old
+ new
@@ -6,10 +6,12 @@
module Bolt
class Target
attr_reader :uri, :options
attr_writer :inventory
+ PRINT_OPTS ||= %w[host user port protocol].freeze
+
# Satisfies the Puppet datatypes API
def self.from_asserted_hash(hash)
new(hash['uri'], hash['options'])
end
@@ -77,10 +79,11 @@
def hash
@uri.hash ^ @options.hash
end
def to_s
- "Target('#{@uri}', #{@options})"
+ opts = @options.select { |k, _| PRINT_OPTS.include? k }
+ "Target('#{@uri}', #{opts})"
end
def host
@uri_obj.hostname
end