diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-04 09:15:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-04 09:15:24 +0000 |
commit | fd6bd8e3ee83881f2f40686b21502926ddf977af (patch) | |
tree | 6093d44e4716db2c1f768c23c78359e34bb8e819 /staslib/gutil.py | |
parent | Adding upstream version 2.3~rc3. (diff) | |
download | nvme-stas-fd6bd8e3ee83881f2f40686b21502926ddf977af.tar.xz nvme-stas-fd6bd8e3ee83881f2f40686b21502926ddf977af.zip |
Adding upstream version 2.3~rc4.upstream/2.3_rc4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'staslib/gutil.py')
-rw-r--r-- | staslib/gutil.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/staslib/gutil.py b/staslib/gutil.py index 1730ac0..9aef347 100644 --- a/staslib/gutil.py +++ b/staslib/gutil.py @@ -6,8 +6,8 @@ # # Authors: Martin Belanger <Martin.Belanger@dell.com> # -'''This module provides utility functions/classes to provide easier to use -access to GLib/Gio/Gobject resources. +'''This module provides utility functions (or classes) that simplify +the use of certain GLib/Gio/Gobject functions/resources. ''' import logging @@ -443,7 +443,7 @@ class TcpChecker: # pylint: disable=too-many-instance-attributes # the GLib context. family = socket.AF_INET if self._traddr.version == 4 else socket.AF_INET6 self._native_sock = socket.socket(family, socket.SOCK_STREAM | socket.SOCK_NONBLOCK, socket.IPPROTO_TCP) - if isinstance(self._host_iface, str): + if self._host_iface and isinstance(self._host_iface, str): self._native_sock.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, self._host_iface.encode('utf-8')) # Convert socket.socket() to a Gio.Socket() object |