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 +4 -4
- data/README.md +7 -9
- data/lib/vmfloaty/utils.rb +3 -3
- data/lib/vmfloaty/version.rb +1 -1
- data/lib/vmfloaty.rb +0 -1
- data/spec/vmfloaty/utils_spec.rb +3 -3
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf8e6d210de6ae23fdd371025ace279b939768d1f197b81b2226f326263bc204
|
4
|
+
data.tar.gz: 7da421b68bb4377e31c4e5784e394ab672adb616ce8be4376e55f0006dd81849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
[![
|
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
|
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
|
-
- [
|
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
|
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
|
-
##
|
152
|
+
## VMPooler API
|
155
153
|
|
156
|
-
This cli tool uses the [
|
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
|
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
|
|
data/lib/vmfloaty/utils.rb
CHANGED
@@ -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
|
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
|
204
|
+
puts message
|
205
205
|
when 'NonstandardPooler'
|
206
206
|
pools = status_response
|
207
207
|
pools.delete 'ok'
|
data/lib/vmfloaty/version.rb
CHANGED
data/lib/vmfloaty.rb
CHANGED
data/spec/vmfloaty/utils_spec.rb
CHANGED
@@ -466,13 +466,13 @@ describe Utils do
|
|
466
466
|
subject
|
467
467
|
end
|
468
468
|
|
469
|
-
it 'prints
|
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
|
-
|
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(
|
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.
|
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:
|
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.
|
110
|
+
rubygems_version: 3.2.32
|
125
111
|
signing_key:
|
126
112
|
specification_version: 4
|
127
113
|
summary: CLI application to interface with vmpooler
|