Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
slapos.core
Commits
085ac44f
Commit
085ac44f
authored
Feb 15, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Garbage collect all non instanciated partitions
parent
f5369534
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
275 additions
and
1 deletion
+275
-1
master/bt5/vifib_slap/PathTemplateItem/portal_alarms/vifib_destroy_non_instanciated_partition.xml
...ortal_alarms/vifib_destroy_non_instanciated_partition.xml
+97
-0
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_destroyNonInstanciatedPartition.xml
...kins/vifib_slap/Alarm_destroyNonInstanciatedPartition.xml
+77
-0
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SalePackingListLine_checkAndDestroyNonInstanciatedPartition.xml
...ckingListLine_checkAndDestroyNonInstanciatedPartition.xml
+99
-0
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
master/bt5/vifib_slap/bt/template_path_list
master/bt5/vifib_slap/bt/template_path_list
+1
-0
No files found.
master/bt5/vifib_slap/PathTemplateItem/portal_alarms/vifib_destroy_non_instanciated_partition.xml
0 → 100644
View file @
085ac44f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_destroyNonInstanciatedPartition
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
vifib_destroy_non_instanciated_partition
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_day_frequency
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
3660.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Destroy non instanciated partition
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_destroyNonInstanciatedPartition.xml
0 → 100644
View file @
085ac44f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
setup_service = portal.portal_preferences.getPreferredInstanceSetupResource()\n
\n
portal.portal_catalog.searchAndActivate(\n
portal_type=\'Sale Packing List Line\',\n
default_resource_uid=portal.restrictedTraverse(setup_service).getUid(),\n
aggregate_portal_type="Software Instance",\n
simulation_state="confirmed",\n
method_id=\'SalePackingListLine_checkAndDestroyNonInstanciatedPartition\',\n
activate_kw={\'tag\': tag}\n
)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
tag, fixit, params
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_destroyNonInstanciatedPartition
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SalePackingListLine_checkAndDestroyNonInstanciatedPartition.xml
0 → 100644
View file @
085ac44f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
# Check the creation date\n
# XXX Could be done in catalog, but it is not indexed in Vifib currently\n
movement = context\n
if (DateTime() - movement.getCreationDate()) >
1:\n
# Instance is not done for more than one day. Search for explanation\n
# does the computer tries to instanciate? If so, recent error_log should be available in log\n
instance = movement.getAggregateValue(portal_type="Software Instance")\n
\n
history = instance.portal_workflow.getInfoFor(instance, \'history\', wf_id=\'software_instance_slap_interface_workflow\')\n
error_report_found = False\n
for history_item in history[::-1]:\n
if history_item[\'action\'] == \'report_computer_partition_error\':\n
error_report_found = True\n
break\n
else:\n
date = history_item[\'time\']\n
if (DateTime() - date) > 1:\n
# No error reported for one day\n
# Computer seems dead/unresponsive: to be handle by another alarm\n
break\n
\n
if error_report_found:\n
# Partition can not be installed for more than one day\n
# Destroy it by: cancelling the instance packing list and create destroy PL\n
try:\n
instance.requestDestroyComputerPartition(comment="Instance can not be instanciated for more than one day")\n
except ValueError:\n
# Under deletion already\n
pass\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingListLine_checkAndDestroyNonInstanciatedPartition
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slap/bt/revision
View file @
085ac44f
564
565
\ No newline at end of file
\ No newline at end of file
master/bt5/vifib_slap/bt/template_path_list
View file @
085ac44f
...
@@ -3,6 +3,7 @@ portal_alarms/confirm_planned_sale_invoice_transaction
...
@@ -3,6 +3,7 @@ portal_alarms/confirm_planned_sale_invoice_transaction
portal_alarms/deliver_subscription_sale_packing_list
portal_alarms/deliver_subscription_sale_packing_list
portal_alarms/stop_confirmed_sale_invoice_transaction
portal_alarms/stop_confirmed_sale_invoice_transaction
portal_alarms/vifib_check_consistency
portal_alarms/vifib_check_consistency
portal_alarms/vifib_destroy_non_instanciated_partition
portal_alarms/vifib_lock_person
portal_alarms/vifib_lock_person
portal_alarms/vifib_lock_software_instance
portal_alarms/vifib_lock_software_instance
portal_alarms/vifib_trigger_build
portal_alarms/vifib_trigger_build
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment