From 0a48d7bf7ee9f48dc9eef3dd162424ed8b69851c Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 8 Nov 2019 11:11:03 -0800 Subject: [PATCH] remove get_systemd_os_info (#7526) Fixes #7500. --- CHANGELOG.md | 5 +++-- certbot/tests/util_test.py | 8 -------- certbot/util.py | 14 -------------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03b4ec995..826a59dd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,9 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). * `certbot.plugins.common.TLSSNI01` has been removed. * The functions `certbot.client.view_config_changes`, `certbot.main.config_changes`, - `certbot.plugins.common.Installer.view_config_changes`, and - `certbot.reverter.Reverter.view_config_changes` have been removed + `certbot.plugins.common.Installer.view_config_changes`, + `certbot.reverter.Reverter.view_config_changes`, and + `certbot.util.get_systemd_os_info` have been removed ### Fixed diff --git a/certbot/tests/util_test.py b/certbot/tests/util_test.py index 65c51bfce..5ced9f78e 100644 --- a/certbot/tests/util_test.py +++ b/certbot/tests/util_test.py @@ -510,14 +510,6 @@ class OsInfoTest(unittest.TestCase): m_distro.linux_distribution.return_value = ("something", "else") self.assertEqual(cbutil.get_os_info(), ("something", "else")) - @mock.patch("warnings.warn") - @mock.patch("certbot.util.distro") - @unittest.skipUnless(sys.platform.startswith("linux"), "requires Linux") - def test_get_systemd_os_info_deprecation(self, _, mock_warn): - import certbot.util as cbutil - cbutil.get_systemd_os_info() - self.assertTrue(mock_warn.called) - @mock.patch("certbot.util.subprocess.Popen") def test_non_systemd_os_info(self, popen_mock): import certbot.util as cbutil diff --git a/certbot/util.py b/certbot/util.py index ea680e050..f435753ef 100644 --- a/certbot/util.py +++ b/certbot/util.py @@ -13,7 +13,6 @@ import re import socket import subprocess import sys -import warnings import configargparse import six @@ -308,19 +307,6 @@ def get_os_info_ua(): return " ".join(get_python_os_info(pretty=True)) return os_info -def get_systemd_os_info(): - """ - Parse systemd /etc/os-release for distribution information - - :returns: (os_name, os_version) - :rtype: `tuple` of `str` - """ - - warnings.warn( - "The get_sytemd_os_like() function is deprecated and will be removed in " - "a future release.", DeprecationWarning, stacklevel=2) - return get_os_info()[:2] - def get_systemd_os_like(): """ Get a list of strings that indicate the distribution likeness to