MCPcopy
hub / github.com/saltstack/salt / update_process_path

Method update_process_path

tests/support/pkg.py:411–425  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

409 return version
410
411 def update_process_path(self):
412 # The installer updates the path for the system, but that doesn't
413 # make it to this python session, so we need to update that
414 if platform.is_windows():
415 os.environ["PATH"] = ";".join([str(self.install_dir), os.getenv("path")])
416 elif platform.is_darwin():
417 # On macOS, salt executables are in install_dir (/opt/salt)
418 # while Python executables are in bin_dir (/opt/salt/bin)
419 path_parts = [str(self.install_dir), str(self.bin_dir), os.getenv("PATH")]
420 os.environ["PATH"] = ":".join(path_parts)
421 else:
422 os.environ["PATH"] = ":".join([str(self.bin_dir), os.getenv("PATH")])
423 # Update the proc's captured environment so run() calls pick up the new PATH
424 if self.proc is not None:
425 self.proc.environ["PATH"] = os.environ["PATH"]
426
427 def __attrs_post_init__(self):
428 self.relenv = packaging.version.parse(self.version) >= packaging.version.parse(

Callers 4

_install_pkgsMethod · 0.95
installMethod · 0.95
install_previousMethod · 0.95
__enter__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected