def init_new(self): """ Create new dbfile without any configuration. """ self.db_path = os.path.join(self.tmpdir, "conf.db") self.db_socket = os.path.join(self.tmpdir, "db.sock") self.db_pidfile = utils.get_pid_path("ovsdb-server") self.ovs_pidfile = utils.get_pid_path("ovs-vswitchd") self.dbschema = "/usr/share/openvswitch/vswitch.ovsschema" self.cleanup = True sm = ServiceManager() #Stop system openvswitch try: sm.stop("openvswitch") except error.CmdError: pass utils.load_module("openvswitch") self.clean() if (os.path.exists(self.db_path)): os.remove(self.db_path) self.init_db() self.start_ovs_vswitchd()
def init_new(self): """ Create new dbfile without any configuration. """ self.db_path = os.path.join(self.tmpdir, "conf.db") self.db_socket = os.path.join(self.tmpdir, "db.sock") self.db_pidfile = utils.get_pid_path("ovsdb-server") self.ovs_pidfile = utils.get_pid_path("ovs-vswitchd") self.dbschema = "/usr/share/openvswitch/vswitch.ovsschema" self.cleanup = True sm = ServiceManager() # Stop system openvswitch try: sm.stop("openvswitch") except error.CmdError: pass utils.load_module("openvswitch") self.clean() if (os.path.exists(self.db_path)): os.remove(self.db_path) self.init_db() self.start_ovs_vswitchd()