Adding HACKING.rst to follow Openstack Guidelines

Change-Id: I2120297aed3d487eb832ab1841a78142e43e3eac
This commit is contained in:
Saad Zaher 2016-01-14 15:01:54 +00:00
parent 61d1674186
commit 21bec7a2f1
2 changed files with 41 additions and 9 deletions

41
HACKING.rst Normal file
View File

@ -0,0 +1,41 @@
Osha Style Commandments
===========================
- Step 1: Read the OpenStack Style Commandments
http://docs.openstack.org/developer/hacking/
- Step 2: Read on
Osha 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.

View File

@ -1,9 +0,0 @@
# hints for Saad
We need to divide the software to be like monitoring component calling evacuation component
We need to decide we will process host by host or all hosts at once ?
Do we need to use threading ??
in docs/diagram.pdf > Stop monitoring this node and alert admin. How can we achieve something like that with the native driver without something to maintain the status of the previous run ?
After adding the notification driver, we can handle the failed nodes by triggering the driver to send notification directly to the admin ...