(self)
| 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( |
no outgoing calls
no test coverage detected