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
Jérome Perrin
slapos.core
Commits
0a60e7b6
Commit
0a60e7b6
authored
Aug 31, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: rename script
parent
64ec24ca
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
24 deletions
+25
-24
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Alarm_computerCheckUpgradeHostingSubscription.py
...apos_pdm/Alarm_computerCheckUpgradeHostingSubscription.py
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_createHostingSubscriptionUpgradeDecision.py
..._pdm/Computer_createHostingSubscriptionUpgradeDecision.py
+3
-2
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_createHostingSubscriptionUpgradeDecision.xml
...pdm/Computer_createHostingSubscriptionUpgradeDecision.xml
+1
-1
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py
+4
-4
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
+16
-16
No files found.
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Alarm_computerCheckUpgradeHostingSubscription.py
View file @
0a60e7b6
...
@@ -10,7 +10,7 @@ if public_scope_uid and friend_scope_uid:
...
@@ -10,7 +10,7 @@ if public_scope_uid and friend_scope_uid:
portal_type
=
'Computer'
,
portal_type
=
'Computer'
,
validation_state
=
'validated'
,
validation_state
=
'validated'
,
default_allocation_scope_uid
=
[
public_scope_uid
,
friend_scope_uid
],
default_allocation_scope_uid
=
[
public_scope_uid
,
friend_scope_uid
],
method_id
=
'Computer_
hostingSubscriptionCreate
UpgradeDecision'
,
method_id
=
'Computer_
createHostingSubscription
UpgradeDecision'
,
activate_kw
=
{
'tag'
:
tag
}
activate_kw
=
{
'tag'
:
tag
}
)
)
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_
hostingSubscriptionCreate
UpgradeDecision.py
→
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_
createHostingSubscription
UpgradeDecision.py
View file @
0a60e7b6
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
partition_list
=
portal
.
portal_catalog
(
portal_type
=
'Computer Partition'
,
partition_list
=
portal
.
portal_catalog
(
portal_type
=
'Computer Partition'
,
...
@@ -21,7 +22,6 @@ for partition in partition_list:
...
@@ -21,7 +22,6 @@ for partition in partition_list:
hosting_subscription_list
.
append
(
hosting_subscription
)
hosting_subscription_list
.
append
(
hosting_subscription
)
else
:
else
:
continue
continue
newer_release
=
hosting_subscription
.
\
newer_release
=
hosting_subscription
.
\
HostingSubscription_getUpgradableSoftwareRelease
()
HostingSubscription_getUpgradableSoftwareRelease
()
if
newer_release
is
None
:
if
newer_release
is
None
:
...
@@ -40,6 +40,7 @@ for partition in partition_list:
...
@@ -40,6 +40,7 @@ for partition in partition_list:
title
=
'A new upgrade is available for %s'
%
hosting_subscription
.
getTitle
()
title
=
'A new upgrade is available for %s'
%
hosting_subscription
.
getTitle
()
)
)
upgrade_decision
.
plan
()
upgrade_decision
.
plan
()
upgrade_decision
.
setStartDate
(
DateTime
())
upgrade_decision_list
.
append
(
upgrade_decision
)
upgrade_decision_list
.
append
(
upgrade_decision
)
return
upgrade_decision_list
return
upgrade_decision_list
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_
hostingSubscriptionCreate
UpgradeDecision.xml
→
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Computer_
createHostingSubscription
UpgradeDecision.xml
View file @
0a60e7b6
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Computer_
hostingSubscriptionCreate
UpgradeDecision
</string>
</value>
<value>
<string>
Computer_
createHostingSubscription
UpgradeDecision
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py
View file @
0a60e7b6
...
@@ -130,17 +130,17 @@ return %s
...
@@ -130,17 +130,17 @@ return %s
computer2
=
self
.
_makeComputer
(
self
.
generateNewId
())
computer2
=
self
.
_makeComputer
(
self
.
generateNewId
())
computer2
.
edit
(
allocation_scope
=
'open/personal'
)
computer2
.
edit
(
allocation_scope
=
'open/personal'
)
self
.
_simulateScript
(
'Computer_
hostingSubscriptionCreate
UpgradeDecision'
)
self
.
_simulateScript
(
'Computer_
createHostingSubscription
UpgradeDecision'
)
try
:
try
:
self
.
portal
.
portal_alarms
.
slapos_pdm_hosting_subscription_create_upgrade_decision
.
\
self
.
portal
.
portal_alarms
.
slapos_pdm_hosting_subscription_create_upgrade_decision
.
\
activeSense
()
activeSense
()
self
.
tic
()
self
.
tic
()
finally
:
finally
:
self
.
_dropScript
(
'Computer_
hostingSubscriptionCreate
UpgradeDecision'
)
self
.
_dropScript
(
'Computer_
createHostingSubscription
UpgradeDecision'
)
self
.
assertEqual
(
'Visited by Computer_
hostingSubscriptionCreate
UpgradeDecision'
,
self
.
assertEqual
(
'Visited by Computer_
createHostingSubscription
UpgradeDecision'
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
self
.
assertNotEqual
(
'Visited by Computer_
hostingSubscriptionCreate
UpgradeDecision'
,
self
.
assertNotEqual
(
'Visited by Computer_
createHostingSubscription
UpgradeDecision'
,
computer2
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
computer2
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
\ No newline at end of file
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
View file @
0a60e7b6
...
@@ -1114,7 +1114,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1114,7 +1114,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
assertEqual
(
upgrade_decision
.
getSimulationState
(),
'started'
)
self
.
assertEqual
(
upgrade_decision
.
getSimulationState
(),
'started'
)
def
testComputer_
hostingSubscriptionCreate
UpgradeDecision_no_newer
(
self
):
def
testComputer_
createHostingSubscription
UpgradeDecision_no_newer
(
self
):
person
=
self
.
_makePerson
()
person
=
self
.
_makePerson
()
computer
=
self
.
_makeComputer
()
computer
=
self
.
_makeComputer
()
computer
.
edit
(
source_administration_value
=
person
)
computer
.
edit
(
source_administration_value
=
person
)
...
@@ -1126,7 +1126,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1126,7 +1126,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
_makeSoftwareInstallation
(
computer
,
url_string
)
self
.
_makeSoftwareInstallation
(
computer
,
url_string
)
self
.
tic
()
self
.
tic
()
upgrade_decision
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()
upgrade_decision
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()
self
.
assertEqual
(
len
(
upgrade_decision
),
0
)
self
.
assertEqual
(
len
(
upgrade_decision
),
0
)
# Create Hosting Subscription
# Create Hosting Subscription
...
@@ -1134,7 +1134,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1134,7 +1134,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
url_string
,
person
)
url_string
,
person
)
self
.
tic
()
self
.
tic
()
upgrade_decision
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()
upgrade_decision
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()
self
.
assertEqual
(
len
(
upgrade_decision
),
0
)
self
.
assertEqual
(
len
(
upgrade_decision
),
0
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
...
@@ -1144,10 +1144,10 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1144,10 +1144,10 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
_requestSoftwareRelease
(
software_product
.
getRelativeUrl
())
self
.
_requestSoftwareRelease
(
software_product
.
getRelativeUrl
())
self
.
tic
()
self
.
tic
()
upgrade_decision
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()
upgrade_decision
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()
self
.
assertEqual
(
len
(
upgrade_decision
),
0
)
self
.
assertEqual
(
len
(
upgrade_decision
),
0
)
def
testComputer_
hostingSubscriptionCreate
UpgradeDecision
(
self
):
def
testComputer_
createHostingSubscription
UpgradeDecision
(
self
):
person
=
self
.
_makePerson
()
person
=
self
.
_makePerson
()
computer
=
self
.
_makeComputer
()
computer
=
self
.
_makeComputer
()
computer
.
edit
(
source_administration_value
=
person
)
computer
.
edit
(
source_administration_value
=
person
)
...
@@ -1173,7 +1173,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1173,7 +1173,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
software_release2
.
getUrlString
())
software_release2
.
getUrlString
())
self
.
tic
()
self
.
tic
()
up_decision
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()[
0
]
up_decision
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()[
0
]
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision
.
UpgradeDecision_getHostingSubscription
().
\
self
.
assertEqual
(
up_decision
.
UpgradeDecision_getHostingSubscription
().
\
...
@@ -1183,11 +1183,11 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1183,11 +1183,11 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
getUrlString
(),
software_release2
.
getUrlString
())
getUrlString
(),
software_release2
.
getUrlString
())
self
.
tic
()
self
.
tic
()
up_decision2
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()
up_decision2
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()
self
.
assertEqual
(
len
(
up_decision2
),
0
)
self
.
assertEqual
(
len
(
up_decision2
),
0
)
def
testComputer_
hostingSubscriptionCreate
UpgradeDecision_with_exist
(
self
):
def
testComputer_
createHostingSubscription
UpgradeDecision_with_exist
(
self
):
person
=
self
.
_makePerson
()
person
=
self
.
_makePerson
()
computer
=
self
.
_makeComputer
()
computer
=
self
.
_makeComputer
()
computer
.
edit
(
source_administration_value
=
person
)
computer
.
edit
(
source_administration_value
=
person
)
...
@@ -1212,7 +1212,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1212,7 +1212,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
_makeSoftwareInstallation
(
computer
,
software_release2
.
getUrlString
())
self
.
_makeSoftwareInstallation
(
computer
,
software_release2
.
getUrlString
())
self
.
tic
()
self
.
tic
()
up_decision
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()[
0
]
up_decision
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()[
0
]
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'planned'
)
# Install the another software release
# Install the another software release
...
@@ -1221,14 +1221,14 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1221,14 +1221,14 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
_makeSoftwareInstallation
(
computer
,
software_release3
.
getUrlString
())
self
.
_makeSoftwareInstallation
(
computer
,
software_release3
.
getUrlString
())
self
.
tic
()
self
.
tic
()
up_decision2
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()[
0
]
up_decision2
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()[
0
]
self
.
assertEqual
(
up_decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'cancelled'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'cancelled'
)
release
=
up_decision2
.
UpgradeDecision_getSoftwareRelease
()
release
=
up_decision2
.
UpgradeDecision_getSoftwareRelease
()
self
.
assertEqual
(
release
.
getUrlString
(),
self
.
assertEqual
(
release
.
getUrlString
(),
software_release3
.
getUrlString
())
software_release3
.
getUrlString
())
def
testComputer_
hostingSubscriptionCreate
UpgradeDecision_rejected
(
self
):
def
testComputer_
createHostingSubscription
UpgradeDecision_rejected
(
self
):
person
=
self
.
_makePerson
()
person
=
self
.
_makePerson
()
computer
=
self
.
_makeComputer
()
computer
=
self
.
_makeComputer
()
computer
.
edit
(
source_administration_value
=
person
)
computer
.
edit
(
source_administration_value
=
person
)
...
@@ -1253,7 +1253,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1253,7 +1253,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
_makeSoftwareInstallation
(
computer
,
software_release2
.
getUrlString
())
self
.
_makeSoftwareInstallation
(
computer
,
software_release2
.
getUrlString
())
self
.
tic
()
self
.
tic
()
decision_list
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()
decision_list
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()
self
.
assertEqual
(
decision_list
[
0
].
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
decision_list
[
0
].
getSimulationState
(),
'planned'
)
# Reject upgrade decision
# Reject upgrade decision
...
@@ -1262,13 +1262,13 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1262,13 +1262,13 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
in_progress
=
software_release2
.
SoftwareRelease_getUpgradeDecisionInProgress
(
in_progress
=
software_release2
.
SoftwareRelease_getUpgradeDecisionInProgress
(
hosting_subscription
.
getUid
())
hosting_subscription
.
getUid
())
decision_list
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()
decision_list
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()
# There is an upgrade decision in progress
# There is an upgrade decision in progress
self
.
assertNotEqual
(
in_progress
,
None
)
self
.
assertNotEqual
(
in_progress
,
None
)
# No new upgrade decision created with software_release2
# No new upgrade decision created with software_release2
self
.
assertEqual
(
decision_list
,
[])
self
.
assertEqual
(
decision_list
,
[])
def
testComputer_
hostingSubscriptionCreate
UpgradeDecision_rejected_2
(
self
):
def
testComputer_
createHostingSubscription
UpgradeDecision_rejected_2
(
self
):
person
=
self
.
_makePerson
()
person
=
self
.
_makePerson
()
computer
=
self
.
_makeComputer
()
computer
=
self
.
_makeComputer
()
computer
.
edit
(
source_administration_value
=
person
)
computer
.
edit
(
source_administration_value
=
person
)
...
@@ -1293,7 +1293,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1293,7 +1293,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
_makeSoftwareInstallation
(
computer
,
software_release2
.
getUrlString
())
self
.
_makeSoftwareInstallation
(
computer
,
software_release2
.
getUrlString
())
self
.
tic
()
self
.
tic
()
decision_list
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()
decision_list
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()
self
.
assertEqual
(
decision_list
[
0
].
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
decision_list
[
0
].
getSimulationState
(),
'planned'
)
# Reject upgrade decision
# Reject upgrade decision
...
@@ -1307,7 +1307,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -1307,7 +1307,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
_makeSoftwareInstallation
(
computer
,
software_release3
.
getUrlString
())
self
.
_makeSoftwareInstallation
(
computer
,
software_release3
.
getUrlString
())
self
.
tic
()
self
.
tic
()
decision2
=
computer
.
Computer_
hostingSubscriptionCreate
UpgradeDecision
()[
0
]
decision2
=
computer
.
Computer_
createHostingSubscription
UpgradeDecision
()[
0
]
self
.
assertEqual
(
decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'rejected'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'rejected'
)
release
=
decision2
.
UpgradeDecision_getSoftwareRelease
()
release
=
decision2
.
UpgradeDecision_getSoftwareRelease
()
...
...
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