lib/bolt/config.rb in bolt-0.19.0 vs lib/bolt/config.rb in bolt-0.19.1

- old
+ new

@@ -28,20 +28,22 @@ :format, :inventoryfile, :log, :modulepath, :puppetdb, + :color, :transport, :transports ) do DEFAULTS = { concurrency: 100, transport: 'ssh', format: 'human', modulepath: [], - puppetdb: {} + puppetdb: {}, + color: true }.freeze TRANSPORT_OPTIONS = %i[password run-as sudo-password extensions private-key tty tmpdir user connect-timeout cacert token-file service-url].freeze @@ -127,12 +129,12 @@ if data['modulepath'] self[:modulepath] = data['modulepath'].split(File::PATH_SEPARATOR) end - %w[inventoryfile concurrency format puppetdb].each do |key| - if data[key] + %w[inventoryfile concurrency format puppetdb color].each do |key| + if data.key?(key) self[key.to_sym] = data[key] end end TRANSPORTS.each do |key, impl| @@ -148,11 +150,11 @@ data = Bolt::Util.read_config_file(path, default_paths, 'config') update_from_file(data) if data end def update_from_cli(options) - %i[concurrency transport format modulepath inventoryfile].each do |key| - self[key] = options[key] if options[key] + %i[concurrency transport format modulepath inventoryfile color].each do |key| + self[key] = options[key] if options.key?(key) end if options[:debug] self[:log]['console'][:level] = :debug elsif options[:verbose]