From c71282a49d05f246f91a131af89cd331cc010c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Wed, 26 Apr 2017 15:54:27 +0300 Subject: [PATCH] Attempt to use hostnames specified in Travis --- .travis.yml | 4 ++++ certidude/const.py | 15 +++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3029f2..b01ee2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,10 @@ cache: directories: - $HOME/.cache/pip addons: + hostname: ca + hosts: + - ca.example.lan ca + - router.example.lan router apt: packages: - python-xattr diff --git a/certidude/const.py b/certidude/const.py index 0c653cf..8b6d2f6 100644 --- a/certidude/const.py +++ b/certidude/const.py @@ -14,16 +14,11 @@ 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" -# 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: - try: - FQDN = socket.getaddrinfo(socket.gethostname(), 0, socket.AF_INET, 0, 0, socket.AI_CANONNAME)[0][3] - except socket.gaierror: - click.echo("Failed to resolve fully qualified hostname of this machine, make sure hostname -f works") - sys.exit(254) +try: + FQDN = socket.getaddrinfo(socket.gethostname(), 0, socket.AF_INET, 0, 0, socket.AI_CANONNAME)[0][3] +except socket.gaierror: + click.echo("Failed to resolve fully qualified hostname of this machine, make sure hostname -f works") + sys.exit(254) if "." in FQDN: HOSTNAME, DOMAIN = FQDN.split(".", 1)