From dc3e46e681d90f961e2a586cd9cbae84dfa79465 Mon Sep 17 00:00:00 2001 From: David Timber Date: Mon, 14 Apr 2025 19:25:45 +0200 Subject: Remove hardcoded /bin/aws --- src/palhm/mod/aws.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') 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", -- cgit v1.2.3-70-g09d2