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
Łukasz Nowak
slapos.core
Commits
492f9204
Commit
492f9204
authored
Jul 28, 2014
by
Alain Takoudjou
Committed by
Rafael Monnerat
Jul 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Base_generateSupportRequestForSlapOS should include some indications
parent
945e47cb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Base_generateSupportRequestForSlapOS.xml
...skins/slapos_crm/Base_generateSupportRequestForSlapOS.xml
+7
-1
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSupportRequestGeneration.py
...TestTemplateItem/testSlapOSCRMSupportRequestGeneration.py
+21
-4
master/bt5/slapos_crm/bt/revision
master/bt5/slapos_crm/bt/revision
+1
-1
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Base_generateSupportRequestForSlapOS.xml
View file @
492f9204
...
@@ -59,6 +59,8 @@ if source_project_value.getPortalType() == "Computer":\n
...
@@ -59,6 +59,8 @@ if source_project_value.getPortalType() == "Computer":\n
destination_decision = source_project_value.getSourceAdministration()\n
destination_decision = source_project_value.getSourceAdministration()\n
elif source_project_value.getPortalType() == "Software Instance":\n
elif source_project_value.getPortalType() == "Software Instance":\n
destination_decision = source_project_value.getSpecialiseValue().getDestinationSection()\n
destination_decision = source_project_value.getSpecialiseValue().getDestinationSection()\n
elif source_project_value.getPortalType() == "Hosting Subscription":\n
destination_decision = source_project_value.getDestinationSection()\n
else:\n
else:\n
destination_decision = None\n
destination_decision = None\n
\n
\n
...
@@ -66,6 +68,7 @@ if portal.ERP5Site_isSupportRequestCreationClosed(destination_decision):\n
...
@@ -66,6 +68,7 @@ if portal.ERP5Site_isSupportRequestCreationClosed(destination_decision):\n
# Stop ticket creation\n
# Stop ticket creation\n
return\n
return\n
\n
\n
title = \'[MONITORING] \' + title\n
support_request_in_progress = portal.portal_catalog.getResultValue(\n
support_request_in_progress = portal.portal_catalog.getResultValue(\n
portal_type = \'Support Request\',\n
portal_type = \'Support Request\',\n
title = title,\n
title = title,\n
...
@@ -74,6 +77,8 @@ support_request_in_progress = portal.portal_catalog.getResultValue(\n
...
@@ -74,6 +77,8 @@ support_request_in_progress = portal.portal_catalog.getResultValue(\n
)\n
)\n
\n
\n
if support_request_in_progress is None:\n
if support_request_in_progress is None:\n
ressource = portal.service_module.\\\n
slapos_crm_monitoring.getRelativeUrl()\n
support_request = portal.\\\n
support_request = portal.\\\n
support_request_module.\\\n
support_request_module.\\\n
slapos_crm_support_request_template_for_monitoring.\\\n
slapos_crm_support_request_template_for_monitoring.\\\n
...
@@ -83,7 +88,8 @@ if support_request_in_progress is None:\n
...
@@ -83,7 +88,8 @@ if support_request_in_progress is None:\n
description = description,\n
description = description,\n
start_date = DateTime(),\n
start_date = DateTime(),\n
destination_decision=destination_decision,\n
destination_decision=destination_decision,\n
source_project_value = source_relative_url\n
source_project_value = source_relative_url,\n
ressource=ressource\n
)\n
)\n
support_request.validate()\n
support_request.validate()\n
\n
\n
...
...
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSupportRequestGeneration.py
View file @
492f9204
...
@@ -184,6 +184,23 @@ class TestSlapOSCloudSupportRequestGeneration(testSlapOSMixin):
...
@@ -184,6 +184,23 @@ class TestSlapOSCloudSupportRequestGeneration(testSlapOSMixin):
self
.
assertEquals
(
support_request
.
getDestinationDecision
(),
self
.
assertEquals
(
support_request
.
getDestinationDecision
(),
host_sub
.
getDestinationSection
())
host_sub
.
getDestinationSection
())
def
test_hosting_subscription_Base_generateSupportRequestForSlapOS
(
self
):
host_sub
=
self
.
_makeHostingSubscription
(
self
.
new_id
)
title
=
"Test Support Request %s"
%
self
.
new_id
support_request
=
host_sub
.
Base_generateSupportRequestForSlapOS
(
title
,
title
,
host_sub
.
getRelativeUrl
()
)
self
.
tic
()
self
.
assertNotEqual
(
support_request
,
None
)
support_request
=
self
.
portal
.
restrictedTraverse
(
support_request
)
# The support request is added to computer owner.
self
.
assertEquals
(
support_request
.
getDestinationDecision
(),
host_sub
.
getDestinationSection
())
def
test_Base_generateSupportRequestForSlapOS_do_not_recreate_if_open
(
self
):
def
test_Base_generateSupportRequestForSlapOS_do_not_recreate_if_open
(
self
):
title
=
"Test Support Request %s"
%
self
.
new_id
title
=
"Test Support Request %s"
%
self
.
new_id
computer
=
self
.
_makeComputer
(
self
.
new_id
)
computer
=
self
.
_makeComputer
(
self
.
new_id
)
...
@@ -775,7 +792,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by C
...
@@ -775,7 +792,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by C
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
_simulateHostingSubscription_checkSofwareInstanceState
(
self
):
def
_simulateHostingSubscription_checkSofwareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSofwareInstanceState'
script_name
=
'HostingSubscription_checkSofwareInstance
Allocation
State'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
...
@@ -783,11 +800,11 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by C
...
@@ -783,11 +800,11 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by C
'*args, **kw'
,
'*args, **kw'
,
'# Script body
\
n
'
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by HostingSubscription_checkSofwareInstanceState') """
)
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by HostingSubscription_checkSofwareInstance
Allocation
State') """
)
transaction
.
commit
()
transaction
.
commit
()
def
_dropHostingSubscription_checkSofwareInstanceState
(
self
):
def
_dropHostingSubscription_checkSofwareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSofwareInstanceState'
script_name
=
'HostingSubscription_checkSofwareInstance
Allocation
State'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
transaction
.
commit
()
...
@@ -806,6 +823,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by H
...
@@ -806,6 +823,6 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by H
finally
:
finally
:
self
.
_dropHostingSubscription_checkSofwareInstanceState
()
self
.
_dropHostingSubscription_checkSofwareInstanceState
()
self
.
assertEqual
(
'Visited by HostingSubscription_checkSofwareInstanceState'
,
self
.
assertEqual
(
'Visited by HostingSubscription_checkSofwareInstance
Allocation
State'
,
host_sub
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
host_sub
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
\ No newline at end of file
master/bt5/slapos_crm/bt/revision
View file @
492f9204
39
40
\ No newline at end of file
\ No newline at end of file
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