csc/Hanlon — pull request #207 by tjmcs (2014-10-22 14:09:42+00:00)
Title: Adds power control (and ability to retrieve power state) to node slice

Includes changes to the server configuration, the Gemfile, node slice and the node slice's RESTful API to support this new functionality (adding new endpoints for getting/updating the power state of the node in question). Specifically:

* Adds a new gem (the `rubyipmi` gem) to the Gemfile; this gem is used to access the underlying BMC (if one exists) via the user's choice of IPMI utilities (support is provided for either `ipmitool` or `freeipmi`); there is an assumption that the user will install one of these two utilities for use with Hanlon if power-control over nodes (and the ability to query the power state of those nodes) is desirable in their environment; there is no attempt made in the current codebase to determine if the appropriate package has been installed locally on the Hanlon server.
* Modifies the RESTful API and CLI for the node slice, adding new `GET /node/{UUID}/power` and `POST /node/{UUID}/power` endpoints to the RESTful API and modifying the CLI to provide access to these two new endpoints; the first is accessed through a new `hanlon node [get] (UUID) [--power,-p]` command, the second via a new `hanlon node update (UUID) --power,-p (POWER_CMD)` command (where the `POWER_CMD` can be any one of `on`,`off`, `reset`, `cycle` or `softShutdown`)
* Fixes a few bugs in the parsing of the `hanlon node` command when the `--hw_id` option was used to specify the node we're interested in; previous to this PR any options that might be passed through after that `--hw_id` value were not parsed correctly.

This PR also includes two small bug fixes to the image and policy slice RESTful APIs that catch bad UUIDs submitted as part of the `GET /image/{UUID}` and `GET /image/{UUID}` methods, respectively (previously, a rather cryptic error was thrown by the RESTful API in these situations). Since they are one-line fixes, it was felt that a separate PR was not required for these bug fixes and they have been included here...