Skip to content

Commit ff1ccf8

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 0cae6ce commit ff1ccf8

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
@@ -475,9 +475,11 @@ def main_sr_uuid(self):
475475

476476
sr_uuid = None
477477
if DEFAULT_SR == 'local':
478+
hostname = self.xe('host-param-get', {'uuid': self.uuid,
479+
'param-name': 'name-label'})
478480
local_sr_uuids = safe_split(
479481
# xe sr-list doesn't support filtering by host UUID!
480-
self.ssh(['xe sr-list host=$HOSTNAME content-type=user minimal=true']),
482+
self.xe('sr-list', {'host': hostname, 'content-type': 'user', 'minimal': 'true'}),
481483
','
482484
)
483485
assert local_sr_uuids, f"DEFAULT_SR=='local' so there must be a local SR on host {self}"

0 commit comments

Comments
 (0)