7538cd7ac8
Moving everything to freezer repo
41 lines
955 B
ReStructuredText
41 lines
955 B
ReStructuredText
Freezer DR Style Commandments
|
|
===========================
|
|
|
|
- Step 1: Read the OpenStack Style Commandments
|
|
http://docs.openstack.org/developer/hacking/
|
|
- Step 2: Read on
|
|
|
|
Freezer DR Specific Commandments
|
|
------------------------------
|
|
|
|
Logging
|
|
-------
|
|
|
|
Use the common logging module, and ensure you ``getLogger``::
|
|
|
|
from oslo_log import log
|
|
|
|
LOG = log.getLogger(__name__)
|
|
|
|
LOG.debug('Foobar')
|
|
|
|
|
|
|
|
Properly Calling Callables
|
|
--------------------------
|
|
|
|
Methods, functions and classes can specify optional parameters (with default
|
|
values) using Python's keyword arg syntax. When providing a value to such a
|
|
callable we prefer that the call also uses keyword arg syntax. For example::
|
|
|
|
def f(required, optional=None):
|
|
pass
|
|
|
|
# GOOD
|
|
f(0, optional=True)
|
|
|
|
# BAD
|
|
f(0, True)
|
|
|
|
This gives us the flexibility to re-order arguments and more importantly
|
|
to add new required arguments. It's also more explicit and easier to read. |