Skip to content

Fix scap install-world -l behavior

Previously running something like scap install-world --version 4.126.0 -l releases1003.eqiad.wmnet would fail with:

Traceback (most recent call last):  
  File "/var/lib/scap/scap/lib/python3.9/site-packages/scap/cli.py", line 754, in run  
    exit_status = app.main(app.extra_arguments)  
  File "/var/lib/scap/scap/lib/python3.9/site-packages/scap/install_world.py", line 151, in main  
    self._install_scap_targets()  
  File "/var/lib/scap/scap/lib/python3.9/site-packages/scap/install_world.py", line 308, in _install_scap_targets  
    self._assign_targets_to_random_master(targets_by_master, targets_no_master)  
  File "/var/lib/scap/scap/lib/python3.9/site-packages/scap/install_world.py", line 332, in _assign_targets_to_random_master  
    targets_by_master.setdefault(random.choice(self.masters), list()).append(  
  File "/usr/lib/python3.9/random.py", line 347, in choice  
    return seq[self._randbelow(len(seq))]  
IndexError: list index out of range  

This commit fixes that bug by ensuring that the local deploy server is
always included in self.masters, regardless of the user's specified
limits/exclusions.

Bug: T380418

Edited by Ahmon Dancy

Merge request reports