Commit graph

228 commits

Author SHA1 Message Date
Ryan McKern
5c794cd2b0 Use the Classname::VERSION pattern
Instead of having a hardcoded version identifier in multiple
locations, we can leverage the Classname::VERSION pattern to have a
single canonical version number that everything can reference
programmatically.
2017-03-01 14:02:58 -08:00
Ryan McKern
0380b5fc9a Gemspec whitespace & tighter version constraints
Pessimistic versioning means that Faraday 0.11.0 will be installed if
the constraint is "~> 0.9", and that will break spec tests due to
newer restrictions in Faraday around how HTTP requests are handled by
rspec. We don't want to break tests.
2017-03-01 14:02:58 -08:00
Ryan McKern
21c42dbffa Clarify license in Gemspec
As per https://opensource.org/licenses/alphabetical, the name should
be Apache-2.0, not Apache.
2017-03-01 14:02:58 -08:00
Ryan McKern
ee0c73dfda Add a little formatting to Rspec 2017-03-01 14:02:58 -08:00
Ryan McKern
8babbe32ce Add Rubocop support to Rakefile 2017-03-01 14:02:58 -08:00
Ryan McKern
573f0d83a9 Update Gemspec
Formatting is slightly more idiomatic now.
2017-03-01 12:44:06 -08:00
Brian Cain
c8525bd0f1 Bump to 0.7.8 2016-12-20 08:42:09 -08:00
Brian Cain
313742ebfd Use actual hostname when creating snapshots in warn msg 2016-12-16 11:21:20 -08:00
Brian Cain
82afa94b6e Properly check for large pool size requests 2016-12-14 11:04:51 -08:00
Brian Cain
b5c6ce7a20 Update usage to match help text 2016-12-09 09:00:32 -08:00
Brian Cain
82a3589db8 Bump to version 0.7.6 2016-12-09 08:57:25 -08:00
Brian Cain
c9b718b379 (#40) Require a --force flag when users request large pools
Prior to this commit, a user could easily steam roll vmpooler by
accidentally adding an extra digit to their get request:

$ floaty get centos=100

Accidentially hitting enter on this would completely drain a centos
pool.

This commit updates that bevaior to force users to use the --force flag
if they really want to get more than 5 vms per template. 5 was choosen
because most vm pools at Puppet were in the 5-10 range.
2016-12-08 21:26:14 -08:00
Brian Cain
345300f58a (#41) Improve help text for vmfloaty
General clean up of the text around the --help flag for all vmfloaty
commands.
2016-12-08 21:15:01 -08:00
Brian Cain
b023339516 Move pretty status printing to Utils namespace and out of commands 2016-12-06 11:21:21 -08:00
Brian Cain
5f0ace0c82 Add gem release Rakefile 2016-12-06 11:21:03 -08:00
Brian Cain
faf92a502d Include colorize in gemspec 2016-12-05 10:29:27 -08:00
Brian Cain
614fc4f7d8 Bump to 0.7.3 2016-12-05 08:42:50 -08:00
Brian Cain
5cfac377ee Merge pull request #38 from nicklewis/improved-status-command
Show the status of pools with `floaty status`
2016-12-05 08:42:21 -08:00
Nick Lewis
7ee73083fd Show the status of pools with floaty status
Previously, `floaty status` would simply pretty-print the JSON output of
the status request to the pooler. That data requires additional
parsing, either human or machine, in order to be able to deduce any
meaningful information about the state of the pooler.

This commit updates `floaty status` to visually represent the state of
pools, indicating which pools have nodes missing or being built. It also
prints the status summary message returned by the pooler, providing an
easy way to tell if everything is okay.

By default, this command will only show the state of pools that aren't
full. If `--verbose` is passed, it will show all pools. If the complete
status information provided by the API is desired, the `--json` option
will print the raw JSON output, preserving the previous functionality.

This also updates the status command to exit non-zero if the status is
not ok.
2016-12-02 13:47:58 -08:00
Brian Cain
a6ff0515d3 Raise TokenError if none provided to Pooler.delete 2016-11-14 09:49:23 -08:00
Brian Cain
97e188cf6d (#36) Update floaty modify command to work with multiple hosts
Prior to this commit, you could only modify 1 host at a time with the
floaty modify command. This commit updates that command to allow users
to modify either all known token vms, or vms passed in as a comma
separated list.
2016-11-12 14:25:08 -08:00
Brian Cain
586f4f5c05 Abstract out getting all active token vms into Utils 2016-11-12 13:59:26 -08:00
Brian Cain
2c9ce5644e Lock Faraday to a version 2016-11-12 13:47:14 -08:00
Brian Cain
414ac22f40 (#37) floaty snapshot warns users about snapshots pending
Vmpooler works by generating a snapshot sha and queueing
the host for taking a snapshot. Depending on the load of
vmpooler, this could take quite a while to complete
making it a little confusing to users trying to use that
snapshot name right away. This commit adds a warning to
the snapshot command about taking snapshots.
2016-11-12 13:39:16 -08:00
Brian Cain
41c0e931bb Bump verison to 0.7.1 2016-10-10 09:31:38 -07:00
Brian Cain
b51a549fe5 (#34) Raise TokenError on operations that require tokens
Prior to this commit, the Pooler class would raise an exception if the
token provided was nil and it attempted to make a request with Faraday.
This fixes that by catching when nil tokens are provided and instead
raising a TokenError to be caught by the consumer.
2016-10-07 18:10:52 -07:00
Brian Cain
08760d8c0b Update LICENSE 2016-09-24 13:40:16 -07:00
Brian Cain
9bd552686c Update to 0.7.0 2016-09-24 13:38:19 -07:00
Brian Cain
c9e582c24a (maint) Catch TokenError from Auth class 2016-09-24 13:34:28 -07:00
Brian Cain
c62c1c7083 (#33) Handle more exceptions in vmfloaty command class
This commit adds more handling to the vmfloaty command class that deals
with exceptions thrown from the Pooler class.
2016-09-24 13:29:43 -07:00
Brian Cain
478761023d (maint) Don't raise error in command class 2016-09-24 13:13:27 -07:00
Brian Cain
8b8ac88578 (maint) Use correct exit code in token delete 2016-09-24 11:19:44 -07:00
Brian Cain
579320e988 (#33) Raise TokenError if no token provided 2016-09-24 11:15:44 -07:00
Brian Cain
8da1deaf6b (#33) Handle Auth class errors
This commit updates the Auth class to properly raise an error when
something goes wrong. It also updates the vmpooler command class to
handle when those errors get raised.
2016-09-24 11:11:14 -07:00
Brian Cain
05e9d5a0cc (#32) Handle vmpooler responses when token is invalid
This commit adds an errors class to handle when pooler tokens are
invalid. The retrieve method in Pooler will raise an AuthError if it
gets an HTTP 401 from the vmpooler.
2016-09-24 10:22:48 -07:00
Brian Cain
86e1792775 Cleanup readme, add example projects 2016-09-17 16:20:28 -07:00
Brian Cain
1d0fc42c80 (#31) Improve how users can provide arguments to commands
Prior this commit, some commands did not accept some options as an
argument and instead only worked through a flag. This commit updates
that behavior to allow users to specify some options through arguments,
while leaving the ability to continue to specify those options through
flags. Command line arguments take precedence over flags. It also fixes
an issue where if a snapshot sha was nil, it would submit a request to
take a snapshot to vmpooler.
2016-09-17 16:07:21 -07:00
Brian Cain
b07139b64c (#29) Don't system exit in Auth class
This commit cleans up the Auth class so that it no longer system exits
if an error occurs. Instead it will return nil if it could not properly
make the request, and it's on the consumer of the class to handle
error cases.
2016-09-15 08:47:38 -07:00
Brian Cain
59eb5678ed Bump to version 0.6.0 2016-08-26 10:09:42 -07:00
Brian Cain
9a1d4a15d6 (#27) Handle URLs that do not have HTTP or HTTPS
Prior to this commit, if a user provided a url without HTTP or HTTPS
Faraday would fail to make a connection to the pooler since it doesn't
seem to handle urls without that. This commit adds a simple check to see
what kind of URI the user gave us, and if its missing that protocol add
it to the beginning of the URL before making a request.
2016-08-26 10:08:38 -07:00
Brian Cain
93e842a2aa (#28) Add new ssh command to vmfloaty
This commit adds a new feature to vmfloaty. It grabs a single vm from
the pooler based on the os template provided and then attempts to ssh
into it from the host machine.
2016-08-26 10:01:08 -07:00
Brian Cain
64a88106a0 Format hosts if --notoken is used 2016-08-15 11:46:19 -07:00
Brian Cain
9612d72453 Add travis badge 2016-07-29 14:18:15 -07:00
Brian Cain
04acc14bf5 Remove require from gemspec 2016-07-29 14:15:16 -07:00
Brian Cain
1e51a6d1c5 Update README.md 2016-07-29 14:12:15 -07:00
Brian Cain
9b86a972e9 Update readme with library example 2016-07-16 16:57:43 -07:00
Brian Cain
1331a48bb2 Change back how version is set 2016-07-09 20:06:30 -07:00
Brian Cain
53868b9532 Change useragent for faraday 2016-07-09 20:03:08 -07:00
Brian Cain
5f6cd1df1d (#25) Remove printing from delete method in pooler api 2016-07-09 19:53:12 -07:00
Brian Cain
a6c5f1dceb (#24) Improve 'get' output
This commit updates how hosts are formated when shown to the user. It
applies a domain to each hostname instead of being a different key.
2016-07-02 11:41:02 -07:00