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
Léo-Paul Géneau
slapos.core
Commits
abf7e090
Commit
abf7e090
authored
Dec 15, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Verbose if why instance isn't allocated or with error
parent
fc99981d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyInstanceIsAllocated.py
..._request/SubscriptionRequest_verifyInstanceIsAllocated.py
+8
-2
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyInstanceIsAllocated.xml
...request/SubscriptionRequest_verifyInstanceIsAllocated.xml
+1
-1
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
...al_components/test.erp5.testSlapOSSubscriptionScenario.py
+5
-0
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyInstanceIsAllocated.py
View file @
abf7e090
...
...
@@ -8,13 +8,19 @@ software_instance_list = portal.portal_catalog(
# Check if at least one software Instance is Allocated
for
instance
in
software_instance_list
:
# All partitions should be allocated
computer_partition
=
instance
.
getAggregateValue
()
if
computer_partition
is
None
:
if
instance
.
getAggregate
()
is
None
:
if
verbose
:
return
"%s isn't allocated"
%
instance
.
getRelativeUrl
()
return
False
if
instance
.
getPortalType
()
==
"Software Instance"
:
if
instance
.
getSlapState
()
==
"start_requested"
and
\
instance
.
SoftwareInstance_hasReportedError
():
if
verbose
:
return
"Instance %s has reported errors: %s"
%
(
instance
.
getRelativeUrl
(),
instance
.
SoftwareInstance_hasReportedError
(
include_message
=
True
))
return
False
return
True
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyInstanceIsAllocated.xml
View file @
abf7e090
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
verbose=False
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
View file @
abf7e090
...
...
@@ -265,6 +265,11 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
payment
=
subscription_request
.
SubscriptionRequest_verifyPaymentBalanceIsReady
()
self
.
assertNotEqual
(
payment
,
None
)
self
.
assertEqual
(
payment
.
getSimulationState
(),
'started'
)
# Assert instance is allocated and without error
self
.
assertEqual
(
True
,
subscription_request
.
SubscriptionRequest_verifyInstanceIsAllocated
(
verbose
=
True
))
self
.
assertEqual
(
subscription_request
.
getSimulationState
(),
"confirmed"
,
"%s != confirmed (%s)"
%
(
subscription_request
.
getSimulationState
(),
subscription_request
.
SubscriptionRequest_processOrdered
()))
...
...
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