From 8d72d770a3f32a045f8e7e39e01b24fb1590df63 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 2 Sep 2024 18:25:34 +0200 Subject: [PATCH] don't rename import as link2xt prefers --- cmdeploy/src/cmdeploy/remote/rdns.py | 4 ++-- cmdeploy/src/cmdeploy/remote/rshell.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmdeploy/src/cmdeploy/remote/rdns.py b/cmdeploy/src/cmdeploy/remote/rdns.py index 3402f53f..ea0ec3e9 100644 --- a/cmdeploy/src/cmdeploy/remote/rdns.py +++ b/cmdeploy/src/cmdeploy/remote/rdns.py @@ -12,7 +12,7 @@ import re -from .rshell import ShellError, shell +from .rshell import CalledProcessError, shell def perform_initial_checks(mail_domain): @@ -44,7 +44,7 @@ def get_dkim_entry(mail_domain, dkim_selector): f"openssl rsa -in /etc/dkimkeys/{dkim_selector}.private " "-pubout 2>/dev/null | awk '/-/{next}{printf(\"%s\",$0)}'" ) - except ShellError: + except CalledProcessError: return dkim_value_raw = f"v=DKIM1;k=rsa;p={dkim_pubkey};s=email;t=s" dkim_value = '" "'.join(re.findall(".{1,255}", dkim_value_raw)) diff --git a/cmdeploy/src/cmdeploy/remote/rshell.py b/cmdeploy/src/cmdeploy/remote/rshell.py index 994223bc..ffc1ab66 100644 --- a/cmdeploy/src/cmdeploy/remote/rshell.py +++ b/cmdeploy/src/cmdeploy/remote/rshell.py @@ -1,12 +1,11 @@ -from subprocess import CalledProcessError as ShellError -from subprocess import check_output +from subprocess import CalledProcessError, check_output def shell(command, fail_ok=False): print(f"$ {command}") try: return check_output(command, shell=True).decode().rstrip() - except ShellError: + except CalledProcessError: if not fail_ok: raise return ""