Skip to content

Commit ec659ba

Browse files
committed
WIP host.main_sr_uuid: don't assume $HOSTNAME is the XAPI name-label
If the host's name-label was changed using XO after installation, but the UNIX hostname was not, $HOSTNAME is wrong. FIXME: likely linked to flaky firstboot test, where XAPI is queried the host before it gets initialized in the DB Signed-off-by: Yann Dirson <[email protected]>
1 parent da0ad8e commit ec659ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/host.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,11 @@ def main_sr_uuid(self):
480480

481481
sr_uuid = None
482482
if DEFAULT_SR == 'local':
483+
hostname = self.xe('host-param-get', {'uuid': self.uuid,
484+
'param-name': 'name-label'})
483485
local_sr_uuids = safe_split(
484486
# xe sr-list doesn't support filtering by host UUID!
485-
self.ssh(['xe sr-list host=$HOSTNAME content-type=user minimal=true']),
487+
self.xe('sr-list', {'host': hostname, 'content-type': 'user', 'minimal': 'true'}),
486488
','
487489
)
488490
assert local_sr_uuids, f"DEFAULT_SR=='local' so there must be a local SR on host {self}"

0 commit comments

Comments
 (0)