6eebebc80b
oslo.i18n uses different marker functions to separate the translatable messages into different catalogs, which the translation teams can prioritize translating. For details, please refer to: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack Added hacking rules for warning, info, critical, error and exception about checking translation for log messages and fixed for below cases only, 1. LOG.error(_("")) 2. LOG.info(_("")) 3. LOG.exception(_("")) 4. LOG.critical(_("")) 5. LOG.warning(_("")) Below scenario is not handled in this patch, If message is passed to LOG call using separate variable, ex. msg = (_("") LOG.error(msg) Change-Id: Idbf8779cdfc41ca1424bebcd101096bec482872f
24 lines
978 B
ReStructuredText
24 lines
978 B
ReStructuredText
glance Style Commandments
|
|
=======================
|
|
|
|
- Step 1: Read the OpenStack Style Commandments
|
|
http://docs.openstack.org/developer/hacking/
|
|
- Step 2: Read on
|
|
|
|
glance Specific Commandments
|
|
--------------------------
|
|
|
|
- [G316] Change assertTrue(isinstance(A, B)) by optimal assert like
|
|
assertIsInstance(A, B)
|
|
- [G317] Change assertEqual(type(A), B) by optimal assert like
|
|
assertIsInstance(A, B)
|
|
- [G318] Change assertEqual(A, None) or assertEqual(None, A) by optimal assert like
|
|
assertIsNone(A)
|
|
- [G319] Validate that debug level logs are not translated
|
|
- [G320] For python 3 compatibility, use six.text_type() instead of unicode()
|
|
- [G321] Validate that LOG messages, except debug ones, have translations
|
|
- [G322] Validate that LOG.info messages use _LI.
|
|
- [G323] Validate that LOG.exception messages use _LE.
|
|
- [G324] Validate that LOG.error messages use _LE.
|
|
- [G325] Validate that LOG.critical messages use _LC.
|
|
- [G326] Validate that LOG.warning messages use _LW. |