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
5f97fcb8
Commit
5f97fcb8
authored
Oct 10, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Render KVMCluster parameter with less parameters.
parent
f7aa629e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
7 deletions
+51
-7
master/bt5/slapos_subscription_request/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSubscriptionRequest.py
...al_components/extension.erp5.SlapOSSubscriptionRequest.py
+7
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Base_instanceXmlToDict.xml
...ns/slapos_subscription_request/Base_instanceXmlToDict.xml
+28
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_renderKVMClusterParameter.py
...equest/SubscriptionCondition_renderKVMClusterParameter.py
+3
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_renderKVMClusterParameter.xml
...quest/SubscriptionCondition_renderKVMClusterParameter.xml
+9
-1
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py
...ubscription_request/SubscriptionRequest_applyCondition.py
+4
-6
No files found.
master/bt5/slapos_subscription_request/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSubscriptionRequest.py
View file @
5f97fcb8
...
...
@@ -25,3 +25,10 @@ def Base_instanceXmlToDict(self, xml):
LOG
(
'SubscriptionRequest'
,
INFO
,
'Issue during parsing xml:'
,
error
=
True
)
return
result_dict
def
SubscriptionCondition_renderParameter
(
self
,
amount
=
0
,
**
kw
):
method_id
=
self
.
getParameterTemplateRendererMethodId
()
if
method_id
is
not
None
:
return
getattr
(
self
,
method_id
)(
amount
=
amount
,
**
kw
)
return
self
.
getTextContent
()
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Base_instanceXmlToDict.xml
0 → 100644
View file @
5f97fcb8
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
Base_instanceXmlToDict
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
SlapOSSubscriptionRequest
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_instanceXmlToDict
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_renderKVMClusterParameter.py
View file @
5f97fcb8
...
...
@@ -5,6 +5,9 @@
This adapt the definition of KVM to instantiate multiple VMs instead a single
for example.
"""
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
import
json
parameter_text
=
context
.
getTextContent
()
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionCondition_renderKVMClusterParameter.xml
View file @
5f97fcb8
...
...
@@ -50,7 +50,15 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
amount=10, **kw
</string>
</value>
<value>
<string>
amount=0, REQUEST=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py
View file @
5f97fcb8
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
pass
#
raise Unauthorized
if
context
.
getSimulationState
()
not
in
[
"draft"
,
"planned"
]:
# Don't modify it anymore
...
...
@@ -20,17 +20,16 @@ if subscription_condition is None:
"It was not possible to find the appropriate Condition %s for this Subscription"
\
%
subscription_condition_reference
)
instance_xml
=
subscription_condition
.
SubscriptionCondition_renderParameter
(
amount
=
int
(
context
.
getQuantity
()))
# Get Subscription condition for this Subscription Request
subscription_configuration
=
{
"instance_xml"
:
subscription_condition
.
getTextContent
()
,
"instance_xml"
:
instance_xml
,
"software_type"
:
subscription_condition
.
getSourceReference
(),
"url"
:
subscription_condition
.
getUrlString
(),
"shared"
:
subscription_condition
.
getRootSlave
(),
"subject_list"
:
subscription_condition
.
getSubjectList
(),
"sla_xml"
:
subscription_condition
.
getSlaXml
(),
"specialise"
:
subscription_condition
.
getRelativeUrl
()
}
email
=
context
.
getDestinationSectionValue
().
getDefaultEmailText
()
now
=
DateTime
()
...
...
@@ -41,6 +40,5 @@ context.edit(
text_content
=
subscription_configuration
[
"instance_xml"
],
start_date
=
now
,
root_slave
=
subscription_configuration
[
"shared"
],
subject_list
=
subscription_configuration
[
"subject_list"
],
specialise_value
=
subscription_condition
)
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