Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 28, 2024
1 parent 16e99cb commit 70f7469
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
25 changes: 20 additions & 5 deletions enterprise_gateway/services/kernels/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,27 @@ async def post(self):
# Users can use inherited_envs to add custom envrioment variables,
# and we ensure PATH, SYSTEMROOT, TEMP, USERPROFILE, WINDIR, COMSPEC, APPDATA, LOCALAPPDATA, PROGRAMDATA and PROGRAMFILES are included
# this allows a more out-of-the-box experience for users
required_envs: set[str] = {"PATH", "SYSTEMROOT", "TEMP", "USERPROFILE", "WINDIR", "COMSPEC",
"APPDATA", "LOCALAPPDATA", "PROGRAMDATA", "PROGRAMFILES"}
env = {key: value for key, value in os.environ.items() if
key in self.inherited_envs or key in required_envs}
required_envs: set[str] = {
"PATH",
"SYSTEMROOT",
"TEMP",
"USERPROFILE",
"WINDIR",
"COMSPEC",
"APPDATA",
"LOCALAPPDATA",
"PROGRAMDATA",
"PROGRAMFILES",
}
env = {
key: value
for key, value in os.environ.items()
if key in self.inherited_envs or key in required_envs
}
else:
env = {key: value for key, value in os.environ.items() if key in self.inherited_envs}
env = {
key: value for key, value in os.environ.items() if key in self.inherited_envs
}

# Allow all KERNEL_* envs and those specified in client_envs and set from client. If this EG
# instance is configured to accept all envs in the payload (i.e., client_envs == '*'), go ahead
Expand Down
4 changes: 3 additions & 1 deletion enterprise_gateway/services/processproxies/processproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,9 @@ async def launch_process(
except OSError:
pass
self.ip = local_ip
if os.name == "nt": # if operating system is Windows then link the win32_interrupt_event from the kernel
if (
os.name == "nt"
): # if operating system is Windows then link the win32_interrupt_event from the kernel
self.win32_interrupt_event = self.local_proc.win32_interrupt_event
self.log.info(
"Local kernel launched on '{}', pid: {}, pgid: {}, KernelID: {}, cmd: '{}'".format(
Expand Down

0 comments on commit 70f7469

Please sign in to comment.