[openstack-dev] [oslo][all] openstack context change for user_name and project_name

Ihar Hrachyshka ihrachys at redhat.com
Tue Jun 9 13:40:20 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi operators/devs,

I have a patch [1] for oslo.context (the library that is used by most
projects to create context objects to pass around) that introduces the
following change for the context:

user_identity is now constructed from user and project names instead
of user-id and project-id, in case names are available.

The change introduces a slight incompatibility in context aware logs
[2] (controlled by oslo.log library). Specifically, before the change,
those log messages looked like:

"date time DEBUG python-path [req-283bde30-6f3d-4f20-83c9-17c3185e2b88
049f3e6a87a649b288bed5543a052dd3 231bb797af67435fa6603282aa461c9a - -
- -] log-message"

where 049f3e6a87a649b288bed5543a052dd3 is user-id and
231bb797af67435fa6603282aa461c9a is projects.

While after the change, the same log message would look like:

"date time DEBUG python-path [req-283bde30-6f3d-4f20-83c9-17c3185e2b88
username projectname - - -] log-message"

The incompatibility would show up only if someone relies on those
fields to represent user and project IDs.

The change is to avoid the need for devstack to override oslo.log for
particular services [3] to get those user and project names, so that
we consume the default format string from oslo.log everywhere and make
our logs consistent and probably more user friendly (it's probably
easier to read user name than user id in your logs). Also we would
avoid bugs like [4] where we miss valuable log info because of old,
inadequate configuration.

The question is: does anyone know of any piece of software or an
operator who relies on particular format of those fields? Does anyone
think that such a change should not go in?

[1]: https://review.openstack.org/#/c/176333/1/oslo_context/context.py
[2]:
http://git.openstack.org/cgit/openstack/oslo.log/tree/oslo_log/_options.
py#n100
[3]: https://review.openstack.org/#/c/172508/
[4]: https://bugs.launchpad.net/neutron/+bug/1433687

Thanks for your consideration
Ihar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVduzBAAoJEC5aWaUY1u577E8H/2MtiFtRRal2KEj23p9Uzt68
Lk3xgAZxr++txM+n8qrSlU24544QMFn9tDXxW7A69lKpHRnyKnB2wnLnC5DCLmFq
LfXgkUZf5Ea+VF6fMNGMYfZT7ljDhsypNqjt49QIAfgZ6pHCLy4JatqYAjte3uus
g5+bt3RoQTwLOPZWU89xsFLkZVpfF31ex/UAkpmo7nvtwsahrXXeJ6KrJMLpA8BW
MELsLbIhuF+pSzhBPyT5S8inQGj5ohtaQU5ybKdCMw+WgoiwqDfGjLOSxSs/gpB9
CSm/grUKhj2dLJkMcwwN+ufuQejVs2p247mBMsYJtXN0KV9JKjdDbKonNTlGhrk=
=H24e
-----END PGP SIGNATURE-----



More information about the OpenStack-dev mailing list