diff options
-rw-r--r-- | src/utils/legacy.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/utils/legacy.py b/src/utils/legacy.py index 747a16f..387f790 100644 --- a/src/utils/legacy.py +++ b/src/utils/legacy.py @@ -194,11 +194,10 @@ def ogChangeRepo(ip, smb_user='opengnsys', smb_pass='og'): err = 0 cmd = f'mount.cifs -o {mode},username={smb_user},password={smb_pass} {new_name} /opt/opengnsys/images' - try: - result = subprocess.run(shlex.split(cmd), check=True) - except: + result = subprocess.run(shlex.split(cmd)) + if result.returncode != 0: err = -1 - logging.error(f'Error mounting {new_name} in /opt/opengnsys/images') + logging.error(f'Error mounting {new_name} in /opt/opengnsys/images with error {result.returncode}') cmd = f'mount.cifs -o {mode},username={smb_user},password={smb_pass} {orig_name} /opt/opengnsys/images' subprocess.run(shlex.split(cmd)) |