Skip to content

Commit f4158b3

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 8801b08 commit f4158b3

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

470470
sr_uuid = None
471471
if DEFAULT_SR == 'local':
472+
hostname = self.xe('host-param-get', {'uuid': self.uuid,
473+
'param-name': 'name-label'})
472474
local_sr_uuids = safe_split(
473475
# xe sr-list doesn't support filtering by host UUID!
474-
self.ssh(['xe sr-list host=$HOSTNAME content-type=user minimal=true']),
476+
self.xe('sr-list', {'host': hostname, 'content-type': 'user', 'minimal': 'true'}),
475477
','
476478
)
477479
assert local_sr_uuids, f"DEFAULT_SR=='local' so there must be a local SR on host {self}"

0 commit comments

Comments
 (0)