mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
(DIO-2700) Vmfloaty should not use the Colorize gem
removing cosmetic use of colorize
This commit is contained in:
parent
1b64ce3b03
commit
6b9b4ea626
5 changed files with 6 additions and 8 deletions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
require 'rubygems'
|
||||
require 'commander'
|
||||
require 'colorize'
|
||||
require 'json'
|
||||
require 'pp'
|
||||
require 'uri'
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class Utils
|
|||
metadata = [host_data['state'], host_data['template'], duration, *tag_pairs]
|
||||
message = "- #{hostname}.#{host_data['domain']} (#{metadata.join(', ')})".gsub(/^/, ' ' * indent)
|
||||
if host_data['state'] && host_data['state'] == 'destroyed'
|
||||
output_target.puts message.colorize(:red)
|
||||
output_target.puts "- DESTROYED #{hostname}.#{host_data['domain']}".gsub(/^/, ' ' * indent)
|
||||
else
|
||||
output_target.puts message
|
||||
end
|
||||
|
|
@ -201,7 +201,7 @@ class Utils
|
|||
rescue StandardError => e
|
||||
FloatyLogger.error "#{name.ljust(width)} #{e.red}"
|
||||
end
|
||||
puts message.colorize(status_response['status']['ok'] ? :default : :red)
|
||||
puts message
|
||||
when 'NonstandardPooler'
|
||||
pools = status_response
|
||||
pools.delete 'ok'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Vmfloaty
|
||||
VERSION = '1.5.0'
|
||||
VERSION = '1.6.0'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -466,13 +466,13 @@ describe Utils do
|
|||
subject
|
||||
end
|
||||
|
||||
it 'prints in red when destroyed' do
|
||||
it 'prints DESTROYED and hostname when destroyed' do
|
||||
fallback = { 'vmpooler_fallback' => 'vmpooler' }
|
||||
service.config.merge! fallback
|
||||
response_body_vmpooler[fqdn_hostname]['state'] = 'destroyed'
|
||||
default_output_second_line_red = " - #{fqdn} (destroyed, #{template}, 7.67/48 hours, user: bob, role: agent)".red
|
||||
default_output_second_line = " - DESTROYED #{fqdn}"
|
||||
expect($stdout).to receive(:puts).with(default_output_first_line)
|
||||
expect($stdout).to receive(:puts).with(default_output_second_line_red)
|
||||
expect($stdout).to receive(:puts).with(default_output_second_line)
|
||||
|
||||
subject
|
||||
end
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ Gem::Specification.new do |s|
|
|||
s.test_files = Dir['spec/**/*']
|
||||
s.require_path = 'lib'
|
||||
|
||||
s.add_dependency 'colorize', '~> 0.8.1'
|
||||
s.add_dependency 'commander', '>= 4.4.3', '< 4.7.0'
|
||||
s.add_dependency 'faraday', '~> 1.5', '>= 1.5.1'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue