Skip to content

Commit 46a977f

Browse files
committed
[202411_RC.1100] Handle exception during Inotify import (sonic-net#21469)
1 parent bada798 commit 46a977f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

platform/mellanox/mlnx-platform-api/sonic_platform/inotify_helper.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2+
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3+
# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
34
# Apache-2.0
45
#
56
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +19,9 @@
1819
"""Helper code for Inotify Implementation for reading file until timeout"""
1920
import os
2021
import errno
22+
# Inotify causes an exception when DEBUG env variable is set to a non-integer convertible
23+
# https://github.com/dsoprea/PyInotify/blob/0.2.10/inotify/adapters.py#L37
24+
os.environ['DEBUG'] = '0'
2125
import inotify.adapters
2226

2327
try:

0 commit comments

Comments
 (0)