<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
As Heat integrates with more OpenStack client libraries it has
become obvious that there is a real lack of consistency in how
client connections are created.<br>
<br>
Our client connection handling can be seen here<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/heat-api/heat/blob/master/heat/engine/clients.py">https://github.com/heat-api/heat/blob/master/heat/engine/clients.py</a><br>
<br>
Horizon's connection handling is throughout these files<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/openstack/horizon/tree/master/openstack_dashboard/api">https://github.com/openstack/horizon/tree/master/openstack_dashboard/api</a><br>
<br>
The consistency issues include:<br>
- Keyword arguments differ for the same attributes<br>
- username, user<br>
- password, api-key<br>
- project_id, tenant_id<br>
- proxy_token, token, preauthtoken<br>
- Positional arguments vary from some to none<br>
- Some clients require an explicit call to authenticate()<br>
- When only a token is passed in, clients differ in what other
parameters are required (if it works at all)<br>
<br>
I think it should be possible to clean this up in a
backwards-compatible way, and it seems that oslo (openstack-common)
has a part to play here.<br>
<br>
I'd like to suggest the following approach for feedback.<br>
<br>
First to handle any differences in client behaviours (token
handling, auth flows):<br>
- Document how clients should initialize and authenticate in both
the username/password and token case. Maybe this exists already?
Keystone developer help would be appreciated here.<br>
- Raise issues for clients who do things differently<br>
<br>
In parallel, to make all client __init__ methods consistent:<br>
- Choose a client that does things the Right Way
(python-keystoneclient?) that other clients should align with.<br>
- Write some code in oslo (openstack-common) which does the
following<br>
- consumes the positional and keyword arguments passed to client
__init__<br>
- log deprecation warnings for all positional arguments, and any
non-blessed keywords<br>
- validates arguments and raises ValueError<br>
- transforms deprecated arguments to a standardised dict which the
client uses for initialization<br>
- Port each client to use this, including a standard chunk to add to
the docstring<br>
<br>
Does this approach sound reasonable? I'd especially like to hear
from any project that objects to their client lib getting this
treatment.<br>
<br>
cheers<br>
</body>
</html>