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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
fc128a05
Commit
fc128a05
authored
Aug 06, 2014
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve script to create Upgrade Decision for Hosting Subscription
parent
e4f85807
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
23 deletions
+12
-23
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_hostingSubscriptionCreateUpgradeDecision.xml
...pdm/Computer_hostingSubscriptionCreateUpgradeDecision.xml
+10
-21
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_tryToCancel.xml
...m/portal_skins/slapos_pdm/UpgradeDecision_tryToCancel.xml
+1
-1
master/bt5/slapos_pdm/bt/revision
master/bt5/slapos_pdm/bt/revision
+1
-1
No files found.
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_hostingSubscriptionCreateUpgradeDecision.xml
View file @
fc128a05
...
...
@@ -73,36 +73,25 @@ for partition in partition_list:\n
hosting_subscription_list.append(hosting_subscription)\n
else:\n
continue\n
\n
is_upgradable = hosting_subscription.HostingSubscription_isUpgradable()\n
if not is_upgradable:\n
continue\n
\n
newer_release_string = hosting_subscription.\\\n
HostingSubscription_getNewerSofwareRelease()\n
if not newer_release_string:\n
continue\n
# XXX - Should try to change method HostingSubscription_getNewerSofwareRelease\n
# to return software_release object directly\n
software_release = portal.portal_catalog.getResultValue(\n
portal_type=\'Software Release\',\n
url_string=newer_release_string)\n
if not software_release:\n
newer_release = hosting_subscription.\\\n
HostingSubscription_getUpgradableSoftwareRelease()\n
if newer_release is None:\n
continue\n
\n
title = \'A new software release is available for %s\' % \\\n
hosting_subscription.getReference()\n
decision_in_progress = software_release.\\\n
decision_in_progress = newer_release.\\\n
SoftwareRelease_getUpgradeDecisionInProgress(hosting_subscription.getUid())\n
\n
if decision_in_progress and \\\n
not decision_in_progress.UpgradeDecision_tryToCancel(newer_release_string):\n
not decision_in_progress.UpgradeDecision_tryToCancel(\n
newer_release.getUrlString()):\n
continue\n
\n
upgrade_decision =
software
_release.SoftwareRelease_createUpgradeDecision(\n
upgrade_decision =
newer
_release.SoftwareRelease_createUpgradeDecision(\n
source_url=hosting_subscription.getRelativeUrl(),\n
title=title)\n
upgrade_decision.confirm()\n
title=\'A new upgrade is available for %s\' % hosting_subscription.getTitle()\n
)\n
upgrade_decision.plan()\n
upgrade_decision_list.append(upgrade_decision)\n
\n
return upgrade_decision_list\n
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_tryToCancel.xml
View file @
fc128a05
...
...
@@ -57,7 +57,7 @@ if upgrade_decision.getSimulationState() in cancel_state_list:\n
current_release = upgrade_decision.UpgradeDecision_getSoftwareRelease()\n
if not current_release:\n
# This upgrade decision is not valid\n
return
Tru
e\n
return
Fals
e\n
if current_release.getUrlString() == new_url_string:\n
# Cannot cancel because the software releases are the same\n
return False\n
...
...
master/bt5/slapos_pdm/bt/revision
View file @
fc128a05
31
\ No newline at end of file
32
\ No newline at end of file
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