From 7fb62349fd646023036b66d5937652d23165e551 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Mon, 29 Apr 2024 14:12:37 +0200 Subject: [PATCH] Always expand '~' in sshkey path --- osc/connection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osc/connection.py b/osc/connection.py index 7a8b37de1..379799a7d 100644 --- a/osc/connection.py +++ b/osc/connection.py @@ -668,6 +668,9 @@ def guess_keyfile(self): def ssh_sign(self, data, namespace, keyfile=None): if not keyfile: keyfile = self.guess_keyfile() + if not keyfile: + raise oscerr.OscIOError(None, "No SSH key configured or auto-detected") + keyfile = os.path.expanduser(keyfile) cmd = [self.ssh_keygen_path, '-Y', 'sign', '-f', keyfile, '-n', namespace, '-q'] proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, encoding="utf-8") signature, _ = proc.communicate(data)