8000 Refactor machine arch name helper (#7818) · localstack/localstack@e7f74ef · GitHub
[go: up one dir, main page]

Skip to content

Commit e7f74ef

Browse files
Refactor machine arch name helper (#7818)
1 parent 83d7780 commit e7f74ef

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

localstack/utils/platform.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,25 @@ def is_redhat() -> bool:
2828
return "rhel" in load_file("/etc/os-release", "")
2929

3030

31-
def get_arch() -> str:
31+
def standardized_arch(arch: str):
3232
"""
33-
Returns the current machine architecture
34-
:return: "amd64" when x86_64, "arm64" if aarch64, platform.machine() otherwise
33+
Returns LocalStack standardised machine architecture name.
3534
"""
36-
arch = platform.machine()
3735
if arch == "x86_64":
3836
return "amd64"
3937
if arch == "aarch64":
4038
return "arm64"
4139
return arch
4240

4341

42+
def get_arch() -> str:
43+
"""
44+
Returns the current machine architecture.
45+
"""
46+
arch = platform.machine()
47+
return standardized_arch(arch)
48+
49+
4450
def get_os() -> str:
4551
if is_mac_os():
4652
return "osx"

0 commit comments

Comments
 (0)
0