From 657af133518699a7462f806b3162376d173cbb69 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 18 Mar 2024 14:49:26 +0100 Subject: virtual: add missing check=True to subprocess.run() Raise exception from subprocess.run() calls as previous code is trying to capture these exceptions to handle de errors. --- src/virtual/ogOperations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/virtual/ogOperations.py b/src/virtual/ogOperations.py index a3f94a8..930382d 100644 --- a/src/virtual/ogOperations.py +++ b/src/virtual/ogOperations.py @@ -418,7 +418,7 @@ class OgVirtualOperations: except: return None - subprocess.run([f'umount {self.OG_IMAGES_PATH}'], shell=True) + subprocess.run([f'umount {self.OG_IMAGES_PATH}'], shell=True, check=True) return True @@ -445,7 +445,7 @@ class OgVirtualOperations: f'ro,nolock,serverino,acl,' \ f'username={samba_config["user"]},' \ f'password={samba_config["pass"]}' - subprocess.run([cmd], shell=True) + subprocess.run([cmd], shell=True, check=True) try: shutil.copy(f'{self.OG_IMAGES_PATH}/{name}', drive_path) -- cgit v1.2.3-18-g5258