From: Ben Pfaff Date: Thu, 26 Aug 2010 16:39:54 +0000 (-0700) Subject: xenserver: Add type-checking to monitor-external-ids script. X-Git-Tag: v1.1.0pre1~26 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=3161c659b79c9bef131628fe6f37d207ed17afdf xenserver: Add type-checking to monitor-external-ids script. Signed-off-by: Ben Pfaff --- diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py index aa0a8eda8..6e7ef11db 100644 --- a/python/ovs/db/types.py +++ b/python/ovs/db/types.py @@ -386,7 +386,7 @@ class Type(object): self.n_min == other.n_min and self.n_max == other.n_max) def __ne__(self, other): - if not isinstance(other, BaseType): + if not isinstance(other, Type): return NotImplemented else: return not (self == other) diff --git a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids index 28aaf78c4..c87171f06 100755 --- a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids +++ b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids @@ -131,6 +131,12 @@ def keep_table_columns(schema, table_name, column_types): if not column: raise error.Error("%s table schema lacks %s column" % (table_name, column_name)) + if column.type != column_type: + raise error.Error("%s column in %s table has type \"%s\", " + "expected type \"%s\"" + % (column_name, table_name, + column.type.toEnglish(), + column_type.toEnglish())) new_columns[column_name] = column table.columns = new_columns return table