xenserver: Add type-checking to monitor-external-ids script.
authorBen Pfaff <blp@nicira.com>
Thu, 26 Aug 2010 16:39:54 +0000 (09:39 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 26 Aug 2010 17:29:43 +0000 (10:29 -0700)
Signed-off-by: Ben Pfaff <blp@nicira.com>
python/ovs/db/types.py
xenserver/usr_share_openvswitch_scripts_monitor-external-ids

index aa0a8eda846c0e5a63861d4b7b83a0ebb5ea043d..6e7ef11db350f9cb369d2dc4085b2acd00e0dddc 100644 (file)
@@ -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)
index 28aaf78c493f31314387cd6b7a535c530271e4c0..c87171f06ad22c98dc23c5b1d7db035a1ee1acba 100755 (executable)
@@ -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