diff --git a/osc/connection.py b/osc/connection.py index 7a8b37de..379799a7 100644 --- a/osc/connection.py +++ b/osc/connection.py @@ -668,6 +668,9 @@ class SignatureAuthHandler(AuthHandlerBase): 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)