Skip to content

Commit

Permalink
address envron search
Browse files Browse the repository at this point in the history
  • Loading branch information
nagworld9 committed Mar 2, 2022
1 parent af75e4f commit 7bf8b40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions azurelinuxagent/common/cgroupconfigurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,7 @@ def __is_process_descendant_of_the_agent(pid):
environ = env_file.read()
if environ and environ[-1] == '\x00':
environ = environ[:-1]
match = re.search(shellutil.PARENT_PROCESS_NAME + "=" + shellutil.AZURE_GUEST_AGENT, environ)
return match is not None
return "{0}={1}".format(shellutil.PARENT_PROCESS_NAME, shellutil.AZURE_GUEST_AGENT) in environ
except Exception:
pass
return False
Expand Down

0 comments on commit 7bf8b40

Please sign in to comment.