Commit 084e931f authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_pdm: Ensure the list contains at least one occurence before compare

parent 5d8fc4dd
...@@ -7,7 +7,7 @@ if root_instance is not None and root_instance.getPortalType() == 'Slave Instanc ...@@ -7,7 +7,7 @@ if root_instance is not None and root_instance.getPortalType() == 'Slave Instanc
return True return True
# Get Computer List # Get Computer List
instance_list = context.getSpecialiseValueList( instance_list = context.getSpecialiseRelatedValueList(
portal_type="Software Instance") portal_type="Software Instance")
computer_list = [] computer_list = []
...@@ -32,7 +32,8 @@ full_software_installation_list = [si for si in ...@@ -32,7 +32,8 @@ full_software_installation_list = [si for si in
validation_state='validated' validation_state='validated'
) if si.getSlapState() == 'start_requested'] ) if si.getSlapState() == 'start_requested']
if len(full_software_installation_list) == len(set(computer_list)): if len(full_software_installation_list) > 0 and \
len(full_software_installation_list) == len(set(computer_list)):
# Software is available for the root instance # Software is available for the root instance
software_installation = full_software_installation_list[0] software_installation = full_software_installation_list[0]
message = software_installation.Base_getNewsDict()['text'] message = software_installation.Base_getNewsDict()['text']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment