[common] change libraries/cli to not depend on the client packages (e.g. use APIs directly)

Registered by Stephan Renatus

Right now, the functions in openstack-common/libraries/cli.rb,

- identity_id
- image_id
- network_id: https://review.openstack.org/#/c/100843/

 depend on the respective python-{keystone,glance,neutron}client packages to be installed (or some other executable with the correct name to be in the PATH).

This poses two problems:

1. Some users might not like the client packages to be installed so widely on the nodes that do not necessarily need them.
2. The clients may be needed at compile-time rather than on converge.

The 2nd point can be worked around by using for example chef_sugar's compile_time function.

There are bits of discussion in this bug report: https://bugs.launchpad.net/openstack-chef/+bug/1330484

Some options that came up:

1. Installing the python-xxxclient in the Chef run and de-installing it at the end (if it has not already been installed or was installed in that chef run by some other recipe)
2. Calling the API directly from Ruby. This could be done a) directly, b) using fog, c) using aviator (OpenStack-specific Ruby gem, http://aviator.github.io/www/), d) fog via knife-openstack (hmm no, this is odd), e) via curl.
3. Creating temporary virtualenv for the python-xxxclient(s) that are needed (this let's us not depend on the package names and those packages being installed in the chef-run)
4. (1) or (3) with python-openstackclient only (NB when it's ready, doesn't do neutron yet :/ )

Blueprint information

Status:
Complete
Approver:
Jan Klare
Priority:
Undefined
Drafter:
Jan Klare
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
Accepted for icehouse
Implementation:
Implemented
Milestone target:
None
Started by
Samuel Cassiba
Completed by
Samuel Cassiba

Related branches

Sprints

Whiteboard

I suggest we go with python-openstackclient (unless the decision is against python-xxxclients), since it's the not-deprecated way of things now. That is, it supports domains with keystone.

There's a new cookbook coming along, cookbook-openstack-client, that will try to replace all this CLI mess with easy to use Chef OpenStack resources. https://review.openstack.org/#/c/126365/.
After that is in place, we'll need to refactor to take advantage of it.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.