ansible/ansible — pull request #8924 by emonty (2014-09-08 15:48:19+00:00)
Title: Further refactoring of OpenStack code

This is a follow on to #8388 and should really be ignored probably until that merges since there's no real way here to submit a dependent PR and not show the contents of the first one. BUT ...

I wanted to put this up there because I've been doing a lot of hacking which is getting long in the tooth. The end goal here is to get all of the code which groks OpenStack internal logic, things like "how do I authenticate" or "how do I get a list of images" into the openstack module_utils library so that the things in library/ are more concerned with being expressions of _ansible_ logic, not tons of repeated cantrips that shore up deficiencies in the upstream libraries. Then, the next step from us at OpenStack is to take the code in the module_utils library and get it into upstream libraries, because most of it is not even partially ansible specific, but ansible has been an excellent case study in the deficiencies of our SDK world. Once that's done, then we can start deleting code in module_utils and replacing with cleaner calls to upstream library.

I've got a POC of the end state of that all on my laptop, but the upstream library changes aren't landed yet, so it's not possible to present that here - but I think that showing the movement of the code in general to module_utils should be clear enough, so that the slimming of module_utils and replacement with a better upstream library should similarly be an easy patch to review.

In the process, and because I needed more features in the OpenStack Infra project, I sucked in some of tylernorth's code to support cinder volumes. I took two of his patches, fixed them up to work with module_utils and then squashed them into a single patch.