Skip to content

Commit 6b4f75c

Browse files
committed
pxe.arp_addresses_for: use ARP_SERVER not PXE_CONFIG_SERVER
In some network we might not even have a PXE server, or no ssh access to it. Signed-off-by: Yann Dirson <[email protected]>
1 parent 490e68e commit 6b4f75c

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

data.py-dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ NETWORKS = {
4949
# PXE config server for automated XCP-ng installation
5050
PXE_CONFIG_SERVER = 'pxe'
5151

52+
# server on MGMT network, where ARP tables can reveal the MACs
53+
ARP_SERVER = PXE_CONFIG_SERVER
54+
5255
# Default VM images location
5356
DEF_VM_URL = 'http://pxe/images/'
5457

lib/pxe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from lib.commands import ssh, scp
2-
from data import PXE_CONFIG_SERVER
2+
from data import ARP_SERVER, PXE_CONFIG_SERVER
33

44
PXE_CONFIG_DIR = "/pxe/configs/custom"
55

@@ -35,7 +35,7 @@ def server_remove_bootconf(mac_address):
3535

3636
def arp_addresses_for(mac_address):
3737
output = ssh(
38-
PXE_CONFIG_SERVER,
38+
ARP_SERVER,
3939
['arp', '-n', '|', 'grep', mac_address, '|', 'awk', '\'{ print $1 }\'']
4040
)
4141
candidate_ips = output.splitlines()

tests/install/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from lib.commands import local_cmd
1212

1313
from data import (ISO_IMAGES, ISO_IMAGES_BASE, ISO_IMAGES_CACHE,
14-
PXE_CONFIG_SERVER, TEST_SSH_PUBKEY, TOOLS)
14+
ARP_SERVER, TEST_SSH_PUBKEY, TOOLS)
1515

1616
# Return true if the version of the ISO doesn't support the source type.
1717
# Note: this is a quick-win hack, to avoid explicit enumeration of supported
@@ -197,7 +197,7 @@ def remastered_iso(installer_iso, answerfile):
197197
After=network-online.target
198198
[Service]
199199
Type=oneshot
200-
ExecStart=/bin/sh -c 'while ! /usr/local/sbin/test-pingpxe.sh "{PXE_CONFIG_SERVER}"; do sleep 1 ; done'
200+
ExecStart=/bin/sh -c 'while ! /usr/local/sbin/test-pingpxe.sh "{ARP_SERVER}"; do sleep 1 ; done'
201201
[Install]
202202
WantedBy=default.target
203203
EOF
@@ -208,7 +208,7 @@ def remastered_iso(installer_iso, answerfile):
208208
#!/bin/sh
209209
case "$1" in
210210
start)
211-
sh -c 'while ! /usr/local/sbin/test-pingpxe.sh "{PXE_CONFIG_SERVER}"; do sleep 1 ; done' & ;;
211+
sh -c 'while ! /usr/local/sbin/test-pingpxe.sh "{ARP_SERVER}"; do sleep 1 ; done' & ;;
212212
stop) ;;
213213
esac
214214
EOF

0 commit comments

Comments
 (0)