From: Justin Pettit Date: Thu, 10 Dec 2009 23:28:49 +0000 (-0800) Subject: xenserver: Fixes related to creating config DB in RPM spec file X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91d38a2e5a03b66f7a294058b039a0d0bf099b69;p=openvswitch xenserver: Fixes related to creating config DB in RPM spec file Some programs require a "Open_vSwitch" table to exist in the configuration DB. This change adds that table when a new DB is created. Also, don't try to create the DB unless it doesn't exist. --- diff --git a/xenserver/vswitch-xen.spec b/xenserver/vswitch-xen.spec index 313f1b63..ba78a4db 100644 --- a/xenserver/vswitch-xen.spec +++ b/xenserver/vswitch-xen.spec @@ -188,9 +188,16 @@ net.ipv4.conf.all.arp_filter = 1 EOF fi -# Create ovs-vswitchd config database -ovsdb-tool create /etc/ovs-vswitchd.conf.db \ - /usr/share/vswitch/vswitch-idl.ovsschema +if test ! -e /etc/ovs-vswitchd.conf.db; then + # Create ovs-vswitchd config database + ovsdb-tool create /etc/ovs-vswitchd.conf.db \ + /usr/share/vswitch/vswitch-idl.ovsschema + + # Create initial table in config database + ovsdb-tool transact /etc/ovs-vswitchd.conf.db \ + '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \ + > /dev/null +fi # Create default or update existing /etc/sysconfig/vswitch. SYSCONFIG=/etc/sysconfig/vswitch