
This patch does 2 things: 1) it fixes the broken formatting of all of the rst files, so they render correctly through sphinx 2) Fix tox so that it runs cleanly against the corrected rst files. Change-Id: I3b3689c61054f051075dc6bc519c02e4c63626f7
3.5 KiB
Add log translation hints for cinder
https://blueprints.launchpad.net/cinder/+spec/log-translation-hints
To update cinder log messages to take advantage of oslo's new feature of supporting translating log messages using different translation domains.
Problem description
Current oslo libraries support translating log messages using different translation domains and oslo would like to see hints in all of our code by the end of juno. So cinder should handle the changes out over the release.
Proposed change
Since there are too many files need to change, so divide this bp into 16 patches according to cinder directories.
├─cinder
│ ├─api
│ ├─backup
│ ├─brick
│ ├─common
│ ├─compute
│ ├─db
│ ├─image
│ ├─keymgr
│ ├─openstack
│ ├─scheduler
│ ├─testing
│ ├─tests
│ ├─transfer
│ ├─volume
│ └─zonemanager
- For each directory's files, we change all the log messages as follows.
-
- Change "LOG.exception(_(" to "LOG.exception(_LE".
- Change "LOG.warning(_(" to "LOG.warning(_LW(".
- Change "LOG.info(_(" to "LOG.info(_LI(".
- Change "LOG.critical(_(" to "LOG.info(_LC(".
Note that this spec and associated blueprint are not to address the problem of removing translation of debug msgs. That work is being addressed by the following spec/blueprint: https://review.openstack.org/#/c/100338/
Alternatives
None
Data model impact
None
REST API impact
None
Security impact
None
Notifications impact
None
Other end user impact
None
Performance Impact
None
Other deployer impact
Developer impact
None
Implementation
Assignee(s)
Primary assignee:
Work Items
- For each directory's files, we change all the log messages as follows.
-
- Change "LOG.exception(_(" to "LOG.exception(_LE".
- Change "LOG.warning(_(" to "LOG.warning(_LW(".
- Change "LOG.info(_(" to "LOG.info(_LI(".
- Change "LOG.critical(_(" to "LOG.info(_LC(".
We handle these changes in the following order:
cinder
cinder/api
cinder/backup
cinder/brick
cinder/common
cinder/compute
cinder/db
cinder/image
cinder/keymgr
cinder/openstack
cinder/scheduler
cinder/testing
cinder/tests
cinder/transfer
cinder/volume
cinder/zonemanager
Add a HACKING check rule to ensure that log messages to relative domain. Using regular expression to check whether log messages with relative _L* function.
= re.compile( log_translation_domain_error r"(.)*LOG\.error\(\s*\_LE('|\")") = re.compile( log_translation_domain_warning r"(.)*LOG\.(warning|warn)\(\s*\_LW('|\")") = re.compile( log_translation_domain_info r"(.)*LOG\.(info)\(\s*\_LI('|\")") = re.compile( log_translation_domain_critical r"(.)*LOG\.(critical)\(\s*\_LC('|\")")
Dependencies
None
Testing
None
Documentation Impact
None