From 21bec7a2f167bef1a3139de447c8d46d032ad1e8 Mon Sep 17 00:00:00 2001 From: Saad Zaher Date: Thu, 14 Jan 2016 15:01:54 +0000 Subject: [PATCH] Adding HACKING.rst to follow Openstack Guidelines Change-Id: I2120297aed3d487eb832ab1841a78142e43e3eac --- HACKING.rst | 41 +++++++++++++++++++++++++++++++++++++++++ development hints | 9 --------- 2 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 HACKING.rst delete mode 100644 development hints diff --git a/HACKING.rst b/HACKING.rst new file mode 100644 index 0000000..007dd7a --- /dev/null +++ b/HACKING.rst @@ -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. \ No newline at end of file diff --git a/development hints b/development hints deleted file mode 100644 index 74ed33d..0000000 --- a/development hints +++ /dev/null @@ -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 ... -