system-config/testinfra/conftest.py
Ian Wienand 711b2493a9 testinfra: silence yaml.load() warnings
Switch to safe_load to silence warnings in output

Change-Id: If91f79a4648920999de8e6bf6e0c9fec82fde233
2020-07-15 07:03:22 +10:00

21 lines
512 B
Python

import os
import pytest
import yaml
@pytest.fixture
def zuul_data():
data = {}
with open('/home/zuul/src/opendev.org/opendev/system-config/inventory/base/gate-hosts.yaml') as f:
inventory = yaml.safe_load(f)
data['inventory'] = inventory
zuul_extra_data_file = os.environ.get('TESTINFRA_EXTRA_DATA')
if os.path.exists(zuul_extra_data_file):
with open(zuul_extra_data_file, 'r') as f:
extra = yaml.load(f)
data['extra'] = extra
return data