masakari/HACKING.rst
poojajadhav 892e9b116c Hacking: do not translate log messages
Community has decided to do not translate log messages anymore.
The motivation behind removing translation jobs for log messages
is that when operators encounters any unfamiliar situations(e.g.
nova error, keystone error etc.), searching on the Internet
based on actual log content would have more results than searching
translated log messages.

In this patch I have added hacking rule to check that logs are
not translated.

Change-Id: I90d53d617aac6839c2f2ab119847cbf24a1300e0
2017-09-25 14:34:25 +05:30

2.1 KiB

masakari Style Commandments

Masakari Specific Commandments

  • [M301] no db session in public API methods (disabled) This enforces a guideline defined in oslo.db.sqlalchemy.session
  • [M302] timeutils.utcnow() wrapper must be used instead of direct calls to datetime.datetime.utcnow() to make it easy to override its return value in tests
  • [M303] capitalize help string Config parameter help strings should have a capitalized first letter
  • [M305] Change assertTrue(isinstance(A, B)) by optimal assert like assertIsInstance(A, B).
  • [M306] Change assertEqual(type(A), B) by optimal assert like assertIsInstance(A, B)
  • [M308] Validate that log messages are not translated.
  • [M309] Don't import translation in tests
  • [M310] Setting CONF.* attributes directly in tests is forbidden. Use self.flags(option=value) instead.
  • [M315] Method's default argument shouldn't be mutable
  • [M316] Ensure that the _() function is explicitly imported to ensure proper translations.
  • [M317] Ensure that jsonutils.%(fun)s must be used instead of json.%(fun)s
  • [M318] Change assertTrue/False(A in/not in B, message) to the more specific assertIn/NotIn(A, B, message)
  • [M319] Check for usage of deprecated assertRaisesRegexp
  • [M320] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs.
  • [M321] Change assertEqual(A in B, True), assertEqual(True, A in B), assertEqual(A in B, False) or assertEqual(False, A in B) to the more specific assertIn/NotIn(A, B)
  • [M322] Check masakari.utils.spawn() is used instead of greenthread.spawn() and eventlet.spawn()
  • [M323] contextlib.nested is deprecated
  • [M324] Config options should be in the central location masakari/conf/
  • [M325] Check for common double word typos
  • [M326] Python 3: do not use dict.iteritems.
  • [M327] Python 3: do not use dict.iterkeys.
  • [M328] Python 3: do not use dict.itervalues.
  • [M329] Deprecated library function os.popen()
  • [M331] LOG.warn is deprecated. Enforce use of LOG.warning.