From: Ben Pfaff Date: Tue, 23 Aug 2011 17:04:14 +0000 (-0700) Subject: ovs.db.types: Use toAtomicType() instead of open-coding it. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca2c5d3d32270210986c76158c0b321aa75e735a;p=openvswitch ovs.db.types: Use toAtomicType() instead of open-coding it. Suggested-by: Reid Price --- diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py index 416d7456..5f50d65e 100644 --- a/python/ovs/db/types.py +++ b/python/ovs/db/types.py @@ -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))