Don't blowup because of missing env var

This commit is contained in:
Pedro Algarvio 2018-11-30 23:31:42 +00:00
parent ae6ca7e4de
commit c40d87cc23
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import functools
import os
import pytest
@ -10,7 +12,7 @@ if os.environ.get('KITCHEN_USERNAME') == 'vagrant':
else:
test_host = testinfra.get_host('paramiko://{KITCHEN_USERNAME}@{KITCHEN_HOSTNAME}:{KITCHEN_PORT}'.format(**os.environ),
ssh_identity_file=os.environ.get('KITCHEN_SSH_KEY'))
else:
elif 'KITCHEN_USERNAME' in os.environ:
test_host = testinfra.get_host('docker://{KITCHEN_USERNAME}@{KITCHEN_CONTAINER_ID}'.format(**os.environ))