From 9af0994ca6144daa45903e182f48e7036bd9047b Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 29 Apr 2016 16:23:52 +0300 Subject: [PATCH] More verbose UA & test UA test fixes --- certbot/le_util.py | 9 ++++++--- certbot/tests/cli_test.py | 4 ++-- certbot/tests/testdata/os-release | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/certbot/le_util.py b/certbot/le_util.py index fcde840c9..d18032d9c 100644 --- a/certbot/le_util.py +++ b/certbot/le_util.py @@ -238,7 +238,9 @@ def get_os_info_ua(filepath="/etc/os-release"): """ if os.path.isfile(filepath): - os_ua = _get_systemd_os_release_var("NAME", filepath=filepath) + os_ua = _get_systemd_os_release_var("PRETTY_NAME", filepath=filepath) + if not os_ua: + os_ua = _get_systemd_os_release_var("NAME", filepath=filepath) if os_ua: return os_ua @@ -396,7 +398,7 @@ def enforce_domain_sanity(domain): domain = domain.encode('ascii').lower() except UnicodeError: error_fmt = (u"Internationalized domain names " - "are not presently supported: {0}") + "are not presently supported: {0}") if isinstance(domain, six.text_type): raise errors.ConfigurationError(error_fmt.format(domain)) else: @@ -423,5 +425,6 @@ def enforce_domain_sanity(domain): # first and last char is not "-" fqdn = re.compile("^((?!-)[A-Za-z0-9-]{1,63}(?