Commit 987de3cb authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_pdm: Set date and skip if product reference is not set.

parent 51f7377b
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>computer = context\n <value> <string>from DateTime import DateTime\n
computer = context\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
full_software_release_list = [si.getUrlString() for si in\n full_software_release_list = [si.getUrlString() for si in\n
...@@ -71,6 +72,9 @@ software_release_list = portal.portal_catalog(\n ...@@ -71,6 +72,9 @@ software_release_list = portal.portal_catalog(\n
upgrade_decision_list = []\n upgrade_decision_list = []\n
for software_release in software_release_list:\n for software_release in software_release_list:\n
software_product_reference = software_release.getAggregateReference()\n software_product_reference = software_release.getAggregateReference()\n
if software_product_reference in [None, ""]:\n
continue\n
\n
sorted_list = portal.SoftwareProduct_getSortedSoftwareReleaseList(\n sorted_list = portal.SoftwareProduct_getSortedSoftwareReleaseList(\n
software_product_reference=software_product_reference)\n software_product_reference=software_product_reference)\n
\n \n
...@@ -98,6 +102,7 @@ for software_release in software_release_list:\n ...@@ -98,6 +102,7 @@ for software_release in software_release_list:\n
elif context.getAllocationScope() in ["open/personal"]:\n elif context.getAllocationScope() in ["open/personal"]:\n
upgrade_decision.plan()\n upgrade_decision.plan()\n
\n \n
upgrade_decision.setStartDate(DateTime())\n
upgrade_decision_list.append(upgrade_decision)\n upgrade_decision_list.append(upgrade_decision)\n
\n \n
return upgrade_decision_list\n return upgrade_decision_list\n
......
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