[ovs-dev] [python idl 01/16] ovs.db.types: Always initialize ref_type attribute.

Ben Pfaff blp at nicira.com
Mon Sep 19 18:18:07 UTC 2011


The ref_type attribute was initialized on some paths but not others.

Found by pychecker.
---
 python/ovs/db/types.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py
index 4e8f8f1..8b29000 100644
--- a/python/ovs/db/types.py
+++ b/python/ovs/db/types.py
@@ -113,6 +113,10 @@ class BaseType(object):
         self.min_length = min_length
         self.max_length = max_length
         self.ref_table = ref_table
+        if ref_table:
+            self.ref_type = 'strong'
+        else:
+            self.ref_type = None
 
     def default(self):
         return ovs.db.data.Atom.default(self.type)
-- 
1.7.4.4




More information about the dev mailing list