mirror of https://git.48k.eu/ogclient
utils: use returncode from subprocess in ogChangeRepo()
... the exception shows the samba password in the logs specify the error which tells us what has happened according to man mount(8) Return Codes.master
parent
92ef3d68aa
commit
8ff6341b69
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue