From d68a9acac238fcc98e0ea7895235942a434f6d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Sun, 18 Sep 2016 18:46:11 +0300 Subject: [PATCH] Work around Travis' long hostnames in const.py instead --- .travis.yml | 1 - certidude/const.py | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index de24afc..9513870 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ cache: directories: - $HOME/.cache/pip addons: - hostname: buildbot apt: packages: - python-ldap diff --git a/certidude/const.py b/certidude/const.py index 33442ce..5d2bb62 100644 --- a/certidude/const.py +++ b/certidude/const.py @@ -13,7 +13,12 @@ SIGNER_SOCKET_PATH = os.path.join(CONFIG_DIR, "signer.sock") if os.getuid() else SIGNER_PID_PATH = os.path.join(CONFIG_DIR, "signer.pid") if os.getuid() else "/run/certidude/signer.pid" SIGNER_LOG_PATH = os.path.join(CONFIG_DIR, "signer.log") if os.getuid() else "/var/log/certidude-signer.log" -FQDN = socket.getaddrinfo(socket.gethostname(), 0, socket.AF_INET, 0, 0, socket.AI_CANONNAME)[0][3] +# Work around the 'asn1 encoding routines:ASN1_mbstring_ncopy:string too long' +# issue within OpenSSL ASN1 parser while running on Travis +if os.getenv("TRAVIS"): + FQDN = "buildbot" +else: + FQDN = socket.getaddrinfo(socket.gethostname(), 0, socket.AF_INET, 0, 0, socket.AI_CANONNAME)[0][3] if "." in FQDN: HOSTNAME, DOMAIN = FQDN.split(".", 1)