def restart(self):
""" Restart ``ovs-vswitchd`` instance. ``ovsdb-server`` is not restarted.
:raises: pexpect.EOF, pexpect.TIMEOUT
"""
self._logger.info("Restarting vswitchd...")
if os.path.isfile(self._vswitchd_pidfile_path):
self._logger.info('Killing ovs-vswitchd...')
with open(self._vswitchd_pidfile_path, "r") as pidfile:
vswitchd_pid = pidfile.read().strip()
tasks.terminate_task(vswitchd_pid, logger=self._logger)
try:
tasks.Process.start(self)
self.relinquish()
except (pexpect.EOF, pexpect.TIMEOUT) as exc:
logging.error("Exception during VSwitch start.")
self._kill_ovsdb()
raise exc
self._logger.info("Vswitchd...Started.")
评论列表
文章目录