X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xenserver%2Fusr_share_openvswitch_scripts_monitor-external-ids;h=f91801d22ebf534221796215d28b7b0c097bdbc7;hb=92467099ee05b930b060d34d05b81bb1322e6fbf;hp=28aaf78c493f31314387cd6b7a535c530271e4c0;hpb=d5beca6881b3ce12bdf6a64e463bdde5d1d0aaaf;p=openvswitch diff --git a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids index 28aaf78c..f91801d2 100755 --- a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids +++ b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids @@ -21,9 +21,11 @@ # Bridge table and duplicates its value to the preferred "xs-network-uuids". import getopt +import os import subprocess import sys import syslog +import time import XenAPI @@ -131,6 +133,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 @@ -183,6 +191,11 @@ def main(argv): idl = ovs.db.idl.Idl(remote, "Open_vSwitch", monitor_uuid_schema_cb) ovs.daemon.daemonize() + + # This daemon is usually started before XAPI, but to complete our + # tasks, we need it. Wait here until it's up. + while not os.path.exists("/var/run/xapi_init_complete.cookie"): + time.sleep(1) bridges = {} interfaces = {}