diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 823db3f..3e1696b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -40,7 +40,8 @@ jobs: pytest --cov src coverage html - name: Archive code coverage html report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: code-coverage-report path: htmlcov/ + overwrite: true diff --git a/src/splitcopy/shared.py b/src/splitcopy/shared.py index 420f5f1..005931c 100644 --- a/src/splitcopy/shared.py +++ b/src/splitcopy/shared.py @@ -274,14 +274,14 @@ def which_sshd(self): logger.info("entering which_sshd()") result, stdout = self.ssh_cmd("sshd -v", exitcode=False, combine=True) if self.use_shell: - if not re.search(r"OpenSSH_", stdout): + if not re.search(r"OpenSSH_|JSSH_", stdout): self.close(err_str="failed to determine remote openssh version") output = stdout.split("\n")[2] else: - if not re.search(r"OpenSSH_", stdout): + if not re.search(r"OpenSSH_|JSSH_", stdout): self.close(err_str="failed to determine remote openssh version") output = stdout.split("\n")[1] - version = re.sub(r"OpenSSH_", "", output) + version = re.sub(r"OpenSSH_|JSSH_", "", output) sshd_version = float(version[0:3]) return sshd_version diff --git a/src/splitcopy/tests/test_paramikoshell.py b/src/splitcopy/tests/test_paramikoshell.py index 24ac363..492f009 100644 --- a/src/splitcopy/tests/test_paramikoshell.py +++ b/src/splitcopy/tests/test_paramikoshell.py @@ -157,6 +157,10 @@ def from_private_key_file(filename): with raises(PasswordRequiredException): paramikoshell.get_pkey_from_file("EC", "/homes/foo/.ssh/bar") + import paramiko + import pytest + dss_key_available = hasattr(paramiko, "DSSKey") + @pytest.mark.skipif(not dss_key_available, reason="paramiko.DSSKey not available (removed in paramiko 3.x)") def test_get_pkey_from_file_dsa(self, monkeypatch: MonkeyPatch): def from_private_key_file(filename): return "dsa key"