aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Timber <dxdt@dev.snart.me>2025-04-14 19:25:45 +0200
committerDavid Timber <dxdt@dev.snart.me>2025-04-14 19:25:45 +0200
commitdc3e46e681d90f961e2a586cd9cbae84dfa79465 (patch)
tree944d3d231eeb0db853ca564684eec129730def9b
parent57e1787cd25a425eb1c425dff58387f5da76037d (diff)
Remove hardcoded /bin/aws
-rw-r--r--src/palhm/mod/aws.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/palhm/mod/aws.py b/src/palhm/mod/aws.py
index 3e7c2b4..18cfb61 100644
--- a/src/palhm/mod/aws.py
+++ b/src/palhm/mod/aws.py
@@ -19,7 +19,7 @@
# SOFTWARE.
from concurrent.futures import ThreadPoolExecutor, Future
from decimal import Decimal
-from enum import Enum
+import sys
from time import sleep
from typing import Callable, Iterable
@@ -29,9 +29,6 @@ from palhm import MUA, BackupBackend, BackupObject, Exec, GlobalContext
from palhm.exceptions import APIFailError
-class CONST (Enum):
- AWSCLI = "/bin/aws"
-
def mks3objkey (keys: Iterable[str]) -> str:
ret = "/".join(keys)
return ret.strip("/")
@@ -180,7 +177,9 @@ class S3BackupBackend (BackupBackend):
for i in pl:
e = Exec()
e.argv = [
- CONST.AWSCLI.value,
+ sys.executable,
+ "-m",
+ "awscli",
"--profile=" + self.profile,
"s3",
"rm",
@@ -207,7 +206,9 @@ class S3BackupBackend (BackupBackend):
e = Exec()
e.argv = [
- CONST.AWSCLI.value,
+ sys.executable,
+ "-m",
+ "awscli",
"--profile=" + self.profile,
"s3",
"cp",