ovs.db.types: Use toAtomicType() instead of open-coding it.
authorBen Pfaff <blp@nicira.com>
Tue, 23 Aug 2011 17:04:14 +0000 (10:04 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Aug 2011 18:57:43 +0000 (11:57 -0700)
Suggested-by: Reid Price <reid@nicira.com>
python/ovs/db/types.py

index 416d7456baa52142fb79f5a9010027f4dd4c0ae4..5f50d65ea41da91d8d2c7ed978d99e36ef513e4e 100644 (file)
@@ -337,8 +337,8 @@ class BaseType(object):
             
     def cInitBaseType(self, indent, var):
         stmts = []
-        stmts.append('ovsdb_base_type_init(&%s, OVSDB_TYPE_%s);' % (
-                var, self.type.to_string().upper()),)
+        stmts.append('ovsdb_base_type_init(&%s, %s);' % (
+                var, self.toAtomicType()))
         if self.enum:
             stmts.append("%s.enum_ = xmalloc(sizeof *%s.enum_);"
                          % (var, var))