Simple mechanical cleanups

* Removed trailing and useless whitespaces
* Removed useless imports.

Signed-off-by: Christopher Glass <christopher.glass@canonical.com>
Merge pull request #1699 from chrisglass/python-api-cleanup

Simple mechanical cleanups

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>