@@ -359,9 +359,10 @@ def pool_has_vm(self, vm_uuid, vm_type='vm'):
359
359
else :
360
360
return self .xe ('vm-list' , {'uuid' : vm_uuid }, minimal = True ) == vm_uuid
361
361
362
- def install_updates (self ):
362
+ def install_updates (self , enablerepo = None ):
363
363
logging .info ("Install updates on host %s" % self )
364
- return self .ssh (['yum' , 'update' , '-y' ])
364
+ enablerepo_cmd = ['--enablerepo=%s' % enablerepo ] if enablerepo is not None else []
365
+ return self .ssh (['yum' , 'update' , '-y' ] + enablerepo_cmd )
365
366
366
367
def restart_toolstack (self , verify = False ):
367
368
logging .info ("Restart toolstack on host %s" % self )
@@ -376,10 +377,11 @@ def is_enabled(self) -> bool:
376
377
# If XAPI is not ready yet, or the host is down, this will throw. We return False in that case.
377
378
return False
378
379
379
- def has_updates (self ):
380
+ def has_updates (self , enablerepo = None ):
381
+ enablerepo_cmd = ['--enablerepo=%s' % enablerepo ] if enablerepo is not None else []
380
382
try :
381
383
# yum check-update returns 100 if there are updates, 1 if there's an error, 0 if no updates
382
- self .ssh (['yum' , 'check-update' ])
384
+ self .ssh (['yum' , 'check-update' ] + enablerepo_cmd )
383
385
# returned 0, else there would have been a SSHCommandFailed
384
386
return False
385
387
except commands .SSHCommandFailed as e :
0 commit comments