vmfloaty 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 622a0112e8e8c09fd70d5c2d2b0f31e89032a907db86aebd84ce019238c3e4f5
4
- data.tar.gz: 38f82e6bbf28d2669219b8f856af7876864ecdcef54e46f44c4d9dab8c09e56d
3
+ metadata.gz: cf8e6d210de6ae23fdd371025ace279b939768d1f197b81b2226f326263bc204
4
+ data.tar.gz: 7da421b68bb4377e31c4e5784e394ab672adb616ce8be4376e55f0006dd81849
5
5
  SHA512:
6
- metadata.gz: 47f457eeda161702eedd0246ea1d4e7fd146044d00d98334009746ae1dc3ab7ee1f5b80e27287ba1c4f330ee07ccdd889348362ede637503265b1b68ae3bd5b6
7
- data.tar.gz: adc9ac4bf7ce2ab2ef4080b7ffc702866aa7a58177c9e6b1ab948d371e51e3deb9e6a0293dda83762633267376db831f0b4eaa036b4a0dc672268ffe51471306
6
+ metadata.gz: 846823d38e3b7dc5cfa066efcda72a6f58ad11ce875529a3ac6443551a138fbc3e05e262226e3dd756e93e8d31c9fa5c3bb4639f139158f5903a95c43bfb9b40
7
+ data.tar.gz: e693187229fb1b845e4a2b24f9bf9b22e7b0e4244887f8c1fc6042e64d6082638266b56421e04a46948b2efc92e4abd3e4d0ccdf28e345e30a89a77909872022
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # vmfloaty
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/vmfloaty.svg)](https://badge.fury.io/rb/vmfloaty)
4
- [![Build Status](https://github.com/puppetlabs/vmfloaty/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/puppetlabs/vmfloaty/actions/workflows/ci.yml)
5
- [![Coverage Status](https://github.com/puppetlabs/vmfloaty/badge.svg?branch=main)](https://coveralls.io/github/puppetlabs/vmfloaty?branch=main)
6
- [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=puppetlabs/vmfloaty)](https://dependabot.com)
4
+ [![CI](https://github.com/puppetlabs/vmfloaty/actions/workflows/ci.yml/badge.svg)](https://github.com/puppetlabs/vmfloaty/actions/workflows/ci.yml)
7
5
 
8
- A CLI helper tool for [Puppet's vmpooler](https://github.com/puppetlabs/vmpooler) to help you stay afloat.
6
+ A CLI helper tool for [Puppet's VMPooler](https://github.com/puppetlabs/vmpooler) to help you stay afloat.
9
7
 
10
8
  ![float image](float.jpg)
11
9
 
@@ -18,7 +16,7 @@ A CLI helper tool for [Puppet's vmpooler](https://github.com/puppetlabs/vmpooler
18
16
  - [Using backends besides VMPooler](#using-backends-besides-vmpooler)
19
17
  - [Valid config keys](#valid-config-keys)
20
18
  - [Tab Completion](#tab-completion)
21
- - [vmpooler API](#vmpooler-api)
19
+ - [VMPooler API](#vmpooler-api)
22
20
  - [Using the Pooler class](#using-the-pooler-class)
23
21
  - [Example Projects](#example-projects)
24
22
  - [Special thanks](#special-thanks)
@@ -41,7 +39,7 @@ $ floaty --help
41
39
 
42
40
  DESCRIPTION:
43
41
 
44
- A CLI helper tool for Puppet's vmpooler to help you stay afloat
42
+ A CLI helper tool for Puppet's VMPooler to help you stay afloat
45
43
 
46
44
  COMMANDS:
47
45
 
@@ -151,13 +149,13 @@ There is also tab completion for zsh:
151
149
  source $(floaty completion --shell zsh)
152
150
  ```
153
151
 
154
- ## vmpooler API
152
+ ## VMPooler API
155
153
 
156
- This cli tool uses the [vmpooler API](https://github.com/puppetlabs/vmpooler/blob/master/API.md).
154
+ This cli tool uses the [VMPooler API](https://github.com/puppetlabs/vmpooler/blob/master/API.md).
157
155
 
158
156
  ## Using the Pooler class
159
157
 
160
- vmfloaty providers a `Pooler` class that gives users the ability to make requests to vmpooler without having to write their own requests. It also provides an `Auth` class for managing vmpooler tokens within your application.
158
+ vmfloaty providers a `Pooler` class that gives users the ability to make requests to VMPooler without having to write their own requests. It also provides an `Auth` class for managing VMPooler tokens within your application.
161
159
 
162
160
  ### Example Projects
163
161
 
@@ -137,14 +137,14 @@ class Utils
137
137
  metadata = [host_data['state'], host_data['template'], duration, *tag_pairs]
138
138
  message = "- #{hostname}.#{host_data['domain']} (#{metadata.join(', ')})".gsub(/^/, ' ' * indent)
139
139
  if host_data['state'] && host_data['state'] == 'destroyed'
140
- output_target.puts message.colorize(:red)
140
+ output_target.puts "- DESTROYED #{hostname}.#{host_data['domain']}".gsub(/^/, ' ' * indent)
141
141
  else
142
142
  output_target.puts message
143
143
  end
144
144
  when 'NonstandardPooler'
145
145
  line = "- #{host_data['fqdn']} (#{host_data['os_triple']}"
146
146
  line += ", #{host_data['hours_left_on_reservation']}h remaining"
147
- line += ", reason: #{host_data['reserved_for_reason']}" unless host_data['reserved_for_reason'].empty?
147
+ line += ", reason: #{host_data['reserved_for_reason']}" unless host_data['reserved_for_reason'].nil? || host_data['reserved_for_reason'].empty?
148
148
  line += ')'
149
149
  output_target.puts line
150
150
  else
@@ -201,7 +201,7 @@ class Utils
201
201
  rescue StandardError => e
202
202
  FloatyLogger.error "#{name.ljust(width)} #{e.red}"
203
203
  end
204
- puts message.colorize(status_response['status']['ok'] ? :default : :red)
204
+ puts message
205
205
  when 'NonstandardPooler'
206
206
  pools = status_response
207
207
  pools.delete 'ok'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Vmfloaty
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.0'
5
5
  end
data/lib/vmfloaty.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'commander'
5
- require 'colorize'
6
5
  require 'json'
7
6
  require 'pp'
8
7
  require 'uri'
@@ -466,13 +466,13 @@ describe Utils do
466
466
  subject
467
467
  end
468
468
 
469
- it 'prints in red when destroyed' do
469
+ it 'prints DESTROYED and hostname when destroyed' do
470
470
  fallback = { 'vmpooler_fallback' => 'vmpooler' }
471
471
  service.config.merge! fallback
472
472
  response_body_vmpooler[fqdn_hostname]['state'] = 'destroyed'
473
- default_output_second_line_red = " - #{fqdn} (destroyed, #{template}, 7.67/48 hours, user: bob, role: agent)".red
473
+ default_output_second_line = " - DESTROYED #{fqdn}"
474
474
  expect($stdout).to receive(:puts).with(default_output_first_line)
475
- expect($stdout).to receive(:puts).with(default_output_second_line_red)
475
+ expect($stdout).to receive(:puts).with(default_output_second_line)
476
476
 
477
477
  subject
478
478
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmfloaty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Cain
@@ -9,22 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-12 00:00:00.000000000 Z
12
+ date: 2022-02-16 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: colorize
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: 0.8.1
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: 0.8.1
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: commander
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
107
  - !ruby/object:Gem::Version
122
108
  version: '0'
123
109
  requirements: []
124
- rubygems_version: 3.2.22
110
+ rubygems_version: 3.2.32
125
111
  signing_key:
126
112
  specification_version: 4
127
113
  summary: CLI application to interface with vmpooler