File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
yascheduler/remote_machine Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1616 check_is_debian_15 ,
1717 check_is_debian_like ,
1818 check_is_linux ,
19+ check_is_darwin ,
1920 check_is_windows ,
2021 check_is_windows7 ,
2122 check_is_windows8 ,
@@ -131,6 +132,12 @@ class RemoteMachineAdapter(PRemoteMachineAdapter):
131132 checks = (* debian_adapter .checks , check_is_debian_15 ),
132133)
133134
135+ darwin_adapter = evolve (
136+ linux_adapter ,
137+ platform = "darwin" ,
138+ checks = (check_is_darwin ,),
139+ )
140+
134141windows_adapter = RemoteMachineAdapter (
135142 platform = "windows" ,
136143 path = MyPureWindowsPath ,
Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ async def check_is_linux(conn: SSHClientConnection) -> bool:
1818 )
1919
2020
21+ @lru_cache
22+ async def check_is_darwin (conn : SSHClientConnection ) -> bool :
23+ "Check for Mac"
24+ proc = await conn .run ("uname" )
25+ return (
26+ proc .returncode == 0
27+ and proc .stdout is not None
28+ and proc .stdout .strip () == "Darwin"
29+ )
30+
31+
2132@lru_cache
2233async def _get_os_release (conn : SSHClientConnection ) -> Optional [Tuple [str ]]:
2334 "Get os release string on linuxes"
Original file line number Diff line number Diff line change 3131 debian_adapter ,
3232 debian_like_adapter ,
3333 linux_adapter ,
34+ darwin_adapter ,
3435 windows7_adapter ,
3536 windows8_adapter ,
3637 windows10_adapter ,
6162 debian_adapter ,
6263 debian_like_adapter ,
6364 linux_adapter ,
65+ darwin_adapter ,
6466 windows10_adapter ,
6567 windows11_adapter ,
6668 windows12_adapter ,
You can’t perform that action at this time.
0 commit comments