Skip to content

Commit

Permalink
Fix for "local variable _COLLECT_NOEXEC_ERRORS referenced before assi…
Browse files Browse the repository at this point in the history
…gnment" (Azure#2935)

* Fix for "local variable _COLLECT_NOEXEC_ERRORS referenced before assignment"

* pylint

---------

Co-authored-by: narrieta <narrieta>
(cherry picked from commit c5181c0)
  • Loading branch information
narrieta authored and narrieta committed Oct 13, 2023
1 parent 14e2965 commit 86a0d37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions azurelinuxagent/common/utils/extensionprocessutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def _check_noexec():
"""
Check if /var is mounted with the noexec flag.
"""
# W0603: Using the global statement (global-statement)
# OK to disable; _COLLECT_NOEXEC_ERRORS is used only within _check_noexec, but needs to persist across calls.
global _COLLECT_NOEXEC_ERRORS # pylint: disable=W0603

try:
agent_dir = conf.get_lib_dir()
with open('/proc/mounts', 'r') as f:
Expand Down

0 comments on commit 86a0d37

Please sign in to comment.