Commit 7baf7f24 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud&accounting: Improvements on Alarm's queries

  Contributed by Romain.
parent a74838cc
...@@ -2,7 +2,8 @@ kw = {} ...@@ -2,7 +2,8 @@ kw = {}
select_dict= {'delivery_uid': None} select_dict= {'delivery_uid': None}
kw.update( kw.update(
portal_type='Simulation Movement', portal_type='Simulation Movement',
select_dict=select_dict, # This is an optimisation to help mariadb selecting a better index
simulation_state=['draft', 'planned', None],
left_join_list=select_dict.keys(), left_join_list=select_dict.keys(),
delivery_uid=None delivery_uid=None
) )
......
portal = context.getPortalObject() portal = context.getPortalObject()
select_dict= {'default_aggregate_uid': None} select_dict= {'default_aggregate_uid': None}
portal.portal_catalog.searchAndActivate( portal.portal_catalog.searchAndActivate(
portal_type=('Slave Instance', 'Software Instance'), parent_uid=context.getPortalObject().software_instance_module.getUid(),
validation_state='validated', validation_state='validated',
default_aggregate_uid=None, default_aggregate_uid=None,
select_dict=select_dict,
left_join_list=select_dict.keys(), left_join_list=select_dict.keys(),
method_id='SoftwareInstance_tryToAllocatePartition', method_id='SoftwareInstance_tryToAllocatePartition',
......
portal = context.getPortalObject() portal = context.getPortalObject()
portal.portal_catalog.searchAndActivate( portal.portal_catalog.searchAndActivate(
portal_type=["Software Instance", "Slave Instance"], aggregate__uid="%",
default_aggregate_relative_url="computer_module/%/%",
validation_state="invalidated", validation_state="invalidated",
slap_state="destroy_requested",
parent_uid=context.getPortalObject().software_instance_module.getUid(),
method_id='SoftwareInstance_tryToUnallocatePartition', method_id='SoftwareInstance_tryToUnallocatePartition',
activate_kw={'tag': tag} activate_kw={'tag': tag}
) )
......
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