mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
Hammer: Make sure we account for the case when hammer is called on another Kea source tree when installing SSL keys
This commit is contained in:
15
hammer.py
15
hammer.py
@@ -1278,12 +1278,17 @@ def _configure_mysql(system, revision, features):
|
|||||||
if 'tls' in features:
|
if 'tls' in features:
|
||||||
if not os.path.isdir(cert_dir):
|
if not os.path.isdir(cert_dir):
|
||||||
execute('sudo mkdir -p {}'.format(cert_dir))
|
execute('sudo mkdir -p {}'.format(cert_dir))
|
||||||
|
# Parent dir of hammer.py.
|
||||||
|
p = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0])))
|
||||||
|
if not os.path.isdir(f'{p}/src/lib/asiolink/testutils/ca'):
|
||||||
|
# Sometimes we call a standalone hammer.py on another Kea source tree. Let's use cwd in that case.
|
||||||
|
p = '.'
|
||||||
for file in [
|
for file in [
|
||||||
'./src/lib/asiolink/testutils/ca/kea-ca.crt',
|
f'{p}/src/lib/asiolink/testutils/ca/kea-ca.crt',
|
||||||
'./src/lib/asiolink/testutils/ca/kea-client.crt',
|
f'{p}/src/lib/asiolink/testutils/ca/kea-client.crt',
|
||||||
'./src/lib/asiolink/testutils/ca/kea-client.key',
|
f'{p}/src/lib/asiolink/testutils/ca/kea-client.key',
|
||||||
'./src/lib/asiolink/testutils/ca/kea-server.crt',
|
f'{p}/src/lib/asiolink/testutils/ca/kea-server.crt',
|
||||||
'./src/lib/asiolink/testutils/ca/kea-server.key',
|
f'{p}/src/lib/asiolink/testutils/ca/kea-server.key',
|
||||||
]:
|
]:
|
||||||
if not os.path.exists(file):
|
if not os.path.exists(file):
|
||||||
print('ERROR: File {} is needed to prepare TLS.'.format(file), file=sys.stderr)
|
print('ERROR: File {} is needed to prepare TLS.'.format(file), file=sys.stderr)
|
||||||
|
Reference in New Issue
Block a user