File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ VM_IMAGES = {
91
91
# Possible values:
92
92
# - 'default': keep using the pool's default SR
93
93
# - 'local': use the first local SR found instead
94
+ # - A UUID of the SR to be used
94
95
DEFAULT_SR = 'default'
95
96
96
97
# Whether to cache VMs on the test host, that is import them only if not already
Original file line number Diff line number Diff line change @@ -527,12 +527,11 @@ def local_vm_srs(self):
527
527
return srs
528
528
529
529
def main_sr_uuid (self ):
530
- """ Main SR is either the default SR, or the first local SR, depending on data.py's DEFAULT_SR. """
530
+ """ Main SR is the default SR, the first local SR, or a specific SR depending on data.py's DEFAULT_SR. """
531
531
try :
532
532
from data import DEFAULT_SR
533
533
except ImportError :
534
534
DEFAULT_SR = 'default'
535
- assert DEFAULT_SR in ['default' , 'local' ]
536
535
537
536
sr_uuid = None
538
537
if DEFAULT_SR == 'local' :
@@ -545,9 +544,12 @@ def main_sr_uuid(self):
545
544
)
546
545
assert local_sr_uuids , f"DEFAULT_SR=='local' so there must be a local SR on host { self } "
547
546
sr_uuid = local_sr_uuids [0 ]
548
- else :
547
+ elif DEFAULT_SR == 'default' :
549
548
sr_uuid = self .pool .param_get ('default-SR' )
550
549
assert sr_uuid , f"DEFAULT_SR='default' so there must be a default SR on the pool of host { self } "
550
+ else :
551
+ sr_uuid = DEFAULT_SR
552
+ assert self .xe ('sr-list' , {'uuid' : sr_uuid }), f"cannot find SR with UUID { sr_uuid } on host { self } "
551
553
assert sr_uuid != "<not in database>"
552
554
return sr_uuid
553
555
You can’t perform that action at this time.
0 commit comments