mirror of
https://github.com/laurivosandi/certidude
synced 2024-12-22 16:25:17 +00:00
Attempt to use hostnames specified in Travis
This commit is contained in:
parent
e87d1c574b
commit
c71282a49d
@ -20,6 +20,10 @@ cache:
|
|||||||
directories:
|
directories:
|
||||||
- $HOME/.cache/pip
|
- $HOME/.cache/pip
|
||||||
addons:
|
addons:
|
||||||
|
hostname: ca
|
||||||
|
hosts:
|
||||||
|
- ca.example.lan ca
|
||||||
|
- router.example.lan router
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- python-xattr
|
- python-xattr
|
||||||
|
@ -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_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"
|
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'
|
try:
|
||||||
# issue within OpenSSL ASN1 parser while running on Travis
|
FQDN = socket.getaddrinfo(socket.gethostname(), 0, socket.AF_INET, 0, 0, socket.AI_CANONNAME)[0][3]
|
||||||
if os.getenv("TRAVIS"):
|
except socket.gaierror:
|
||||||
FQDN = "buildbot"
|
click.echo("Failed to resolve fully qualified hostname of this machine, make sure hostname -f works")
|
||||||
else:
|
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:
|
if "." in FQDN:
|
||||||
HOSTNAME, DOMAIN = FQDN.split(".", 1)
|
HOSTNAME, DOMAIN = FQDN.split(".", 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user