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
Titouan Soulard
slapos.core
Commits
5ea3f7f1
Commit
5ea3f7f1
authored
Feb 28, 2024
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: drop Person_isAllowedToAllocate
parent
3553a332
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
141 deletions
+1
-141
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_isAllowedToAllocate.py
...m/portal_skins/slapos_cloud/Person_isAllowedToAllocate.py
+0
-12
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_isAllowedToAllocate.xml
.../portal_skins/slapos_cloud/Person_isAllowedToAllocate.xml
+0
-62
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToAllocatePartition.py
...s/slapos_cloud/SoftwareInstance_tryToAllocatePartition.py
+0
-6
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py
...al_components/test.erp5.testSlapOSCloudAllocationAlarm.py
+1
-61
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_isAllowedToAllocate.py
deleted
100644 → 0
View file @
3553a332
return
True
# Disabled functionality
#section_uid = context.getSourceSectionUid()
#customer_uid = context.getDestinationSectionUid()
#simulation_state = context.getPortalCurrentInventoryStateList() + context.getPortalTransitInventoryStateList()
#balance = context.portal_simulation.getInventoryAssetPrice(
# node_category_strict_membership='account_type/asset/receivable',
# simulation_state=simulation_state,
# section_uid=section_uid,
# mirror_section_uid=customer_uid)
#return balance <= 0.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_isAllowedToAllocate.xml
deleted
100644 → 0
View file @
3553a332
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Person_isAllowedToAllocate
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToAllocatePartition.py
View file @
5ea3f7f1
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
,
ComplexQuery
from
zExceptions
import
Unauthorized
if
context
.
getPortalType
()
not
in
(
'Software Instance'
,
'Slave Instance'
):
raise
TypeError
(
'%s is not supported'
%
context
.
getPortalType
())
...
...
@@ -46,8 +45,6 @@ def assignComputePartition(software_instance, instance_tree):
person
=
instance_tree
.
getDestinationSectionValue
(
portal_type
=
'Person'
)
if
person
is
None
:
raise
ValueError
(
'%s does not have person related'
%
instance_tree
.
getRelativeUrl
())
if
not
person
.
Person_isAllowedToAllocate
():
raise
Unauthorized
(
'Allocation disallowed'
)
tag
=
None
try
:
...
...
@@ -132,9 +129,6 @@ try:
except
ValueError
,
e
:
# It was not possible to find free Compute Partition
markHistory
(
software_instance
,
'Allocation failed: no free Compute Partition %s'
%
e
)
except
Unauthorized
,
e
:
# user has bad balance
markHistory
(
software_instance
,
'Allocation failed: %s'
%
e
)
else
:
if
compute_partition_url
is
not
None
:
try
:
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py
View file @
5ea3f7f1
This diff is collapsed.
Click to expand it.
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