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
2700da54
Commit
2700da54
authored
May 12, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: drop SubscriptionRequest_processRequest
parent
92d00418
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
176 deletions
+0
-176
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_processRequest.py
...ubscription_request/SubscriptionRequest_processRequest.py
+0
-46
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_processRequest.xml
...bscription_request/SubscriptionRequest_processRequest.xml
+0
-62
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
...ortal_components/test.erp5.testSlapOSSubscriptionSkins.py
+0
-68
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_processRequest.py
deleted
100644 → 0
View file @
92d00418
if
context
.
getAggregate
()
is
not
None
:
return
subscription_condition
=
context
.
getSpecialiseValue
(
portal_type
=
'Subscription Condition'
)
if
subscription_condition
is
None
:
return
person
=
context
.
getDestinationSectionValue
()
if
person
is
None
:
return
if
context
.
getSimulationState
()
==
"confirmed"
:
return
request_kw
=
{}
default_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
if
subscription_condition
.
getUrlString
()
is
None
:
raise
ValueError
(
"url_string cannot be None"
)
request_kw
.
update
(
software_release
=
subscription_condition
.
getUrlString
(),
# Bad title
software_title
=
context
.
getTitle
()
+
" %s"
%
str
(
context
.
getUid
()),
software_type
=
subscription_condition
.
getSourceReference
(
"default"
),
instance_xml
=
(
subscription_condition
.
SubscriptionCondition_renderParameter
(
amount
=
int
(
context
.
getQuantity
())
)
or
default_xml
).
strip
(),
sla_xml
=
subscription_condition
.
getSlaXml
(
default_xml
).
strip
(),
shared
=
bool
(
subscription_condition
.
getRootSlave
(
0
)),
state
=
"started"
,
project_reference
=
subscription_condition
.
getFollowUpReference
()
)
person
.
requestSoftwareInstance
(
**
request_kw
)
requested_software_instance
=
context
.
REQUEST
.
get
(
'request_instance'
)
if
requested_software_instance
is
None
:
return
# Save the requested instance tree
context
.
setAggregate
(
requested_software_instance
.
getSpecialise
())
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_processRequest.xml
deleted
100644 → 0
View file @
92d00418
<?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>
SubscriptionRequest_processRequest
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
View file @
2700da54
...
@@ -672,74 +672,6 @@ class TestSubscriptionRequest_createRelatedSaleInvoiceTransaction(TestSubscripti
...
@@ -672,74 +672,6 @@ class TestSubscriptionRequest_createRelatedSaleInvoiceTransaction(TestSubscripti
def
test_creation_of_related_sale_invoice_transaction_q10
(
self
):
def
test_creation_of_related_sale_invoice_transaction_q10
(
self
):
self
.
_test_creation_of_related_sale_invoice_transaction
(
10
)
self
.
_test_creation_of_related_sale_invoice_transaction
(
10
)
class
SubscriptionRequest_processRequest
(
TestSubscriptionSkinsMixin
):
def
test_process_request_person_is_none
(
self
):
subscription_request
=
self
.
newSubscriptionRequest
(
quantity
=
1
)
self
.
assertEqual
(
None
,
subscription_request
.
SubscriptionRequest_processRequest
())
def
test_process_request_simulation_state
(
self
):
person
=
self
.
makePerson
()
subscription_request
=
self
.
newSubscriptionRequest
(
quantity
=
1
,
destination_section_value
=
person
,
url_string
=
"https://%s/software.cfg"
%
self
.
new_id
,
sla_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="oi">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
text_content
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="xx">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
root_slave
=
False
,
source_reference
=
"test_for_test_123"
)
subscription_request
.
plan
()
subscription_request
.
order
()
subscription_request
.
confirm
()
self
.
assertEqual
(
None
,
subscription_request
.
SubscriptionRequest_processRequest
())
def
test_process_request
(
self
):
person
=
self
.
makePerson
()
subscription_condition
=
self
.
newSubscriptionCondition
(
url_string
=
"https://%s/software.cfg"
%
self
.
new_id
,
sla_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="oi">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
text_content
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="xx">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
root_slave
=
False
,
source_reference
=
"test_for_test_123"
)
subscription_request
=
self
.
newSubscriptionRequest
(
quantity
=
1
,
destination_section_value
=
person
,
specialise_value
=
subscription_condition
)
self
.
tic
()
subscription_request
.
SubscriptionRequest_processRequest
()
software_instance
=
subscription_request
.
getAggregateValue
(
portal_type
=
"Instance Tree"
)
self
.
assertEqual
(
software_instance
.
getSourceReference
(),
"test_for_test_123"
)
self
.
assertEqual
(
software_instance
.
getUrlString
(),
"https://%s/software.cfg"
%
self
.
new_id
)
self
.
assertEqual
(
software_instance
.
getTextContent
(),
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="xx">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
)
self
.
assertEqual
(
software_instance
.
getSlaXml
(),
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="oi">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
)
self
.
assertEqual
(
software_instance
.
getSlapState
(),
"start_requested"
)
class
TestSubscriptionRequest_sendAcceptedNotification
(
TestSubscriptionSkinsMixin
):
class
TestSubscriptionRequest_sendAcceptedNotification
(
TestSubscriptionSkinsMixin
):
...
...
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