mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 17:10:12 +01:00
ovs: avoid asking nm-sudo if ovsdb socket does not exist
Starting with OVS plugin installed but OVS service stopped, would lead to
<trace> [1631531732.8896] ovsdb: connect: opening /run/openvswitch/db.sock failed ("error connecting socket (No such file or directory)"). Retry with nm-sudo
...
<trace> [1631531732.9751] ovsdb: connect: failure to get FD from nm-sudo: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code1: error connecting socket (No such file or directory)
If we already know that the socket file does not exist, we don't need to ask nm-sudo.
That would only make sense, if nm-sudo somehow saw a different file systemd than
NetworkManager, but that is (currently) not the case.
This commit is contained in:
parent
d7c0dcc7b4
commit
3a3613b561
1 changed files with 5 additions and 0 deletions
|
|
@ -2403,6 +2403,11 @@ _ovsdb_connect_idle(gpointer user_data, GCancellable *cancellable)
|
|||
priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
|
||||
fd = nm_sudo_utils_open_fd(NM_SUDO_GET_FD_TYPE_OVSDB_SOCKET, &error);
|
||||
if (fd == -ENOENT) {
|
||||
_LOGT("connect: opening %s failed (\"%s\")", NM_OVSDB_SOCKET, error->message);
|
||||
ovsdb_disconnect(self, FALSE, FALSE);
|
||||
return;
|
||||
}
|
||||
if (fd < 0) {
|
||||
_LOGT("connect: opening %s failed (\"%s\"). Retry with nm-sudo",
|
||||
NM_OVSDB_SOCKET,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue