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
d89d412a
Commit
d89d412a
authored
Sep 09, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: fix method name in alarm script
parent
d538f2ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkHostingSubscriptionState.py
...pos_crm_monitoring/Alarm_checkHostingSubscriptionState.py
+1
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+11
-11
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkHostingSubscriptionState.py
View file @
d89d412a
...
...
@@ -3,7 +3,7 @@ portal = context.getPortalObject()
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Hosting Subscription'
,
validation_state
=
'validated'
,
method_id
=
'HostingSubscription_checkSofwareInstanceState'
,
method_id
=
'HostingSubscription_checkSof
t
wareInstanceState'
,
activate_kw
=
{
'tag'
:
tag
}
)
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
d89d412a
...
...
@@ -1063,8 +1063,8 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(testSlapOSMixin):
hosting_subscription
.
requestStart
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
def
_simulateHostingSubscription_checkSofwareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSofwareInstanceState'
def
_simulateHostingSubscription_checkSof
t
wareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSof
t
wareInstanceState'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
...
...
@@ -1072,11 +1072,11 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(testSlapOSMixin):
'*args, **kw'
,
'# Script body
\
n
'
"""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_checkSof
t
wareInstanceState') """
)
transaction
.
commit
()
def
_dropHostingSubscription_checkSofwareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSofwareInstanceState'
def
_dropHostingSubscription_checkSof
t
wareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSof
t
wareInstanceState'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
...
...
@@ -1084,30 +1084,30 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by H
def
test_alarm_check_instance_in_error_validated_hosting_subscription
(
self
):
host_sub
=
self
.
_makeHostingSubscription
()
self
.
_simulateHostingSubscription_checkSofwareInstanceState
()
self
.
_simulateHostingSubscription_checkSof
t
wareInstanceState
()
try
:
self
.
portal
.
portal_alarms
.
slapos_crm_check_instance_in_error
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropHostingSubscription_checkSofwareInstanceState
()
self
.
_dropHostingSubscription_checkSof
t
wareInstanceState
()
self
.
assertEqual
(
'Visited by HostingSubscription_checkSofwareInstanceState'
,
self
.
assertEqual
(
'Visited by HostingSubscription_checkSof
t
wareInstanceState'
,
host_sub
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_check_instance_in_error_archived_hosting_subscription
(
self
):
host_sub
=
self
.
_makeHostingSubscription
()
host_sub
.
archive
()
self
.
_simulateHostingSubscription_checkSofwareInstanceState
()
self
.
_simulateHostingSubscription_checkSof
t
wareInstanceState
()
try
:
self
.
portal
.
portal_alarms
.
slapos_crm_check_instance_in_error
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropHostingSubscription_checkSofwareInstanceState
()
self
.
_dropHostingSubscription_checkSof
t
wareInstanceState
()
self
.
assertNotEqual
(
'Visited by HostingSubscription_checkSofwareInstanceState'
,
self
.
assertNotEqual
(
'Visited by HostingSubscription_checkSof
t
wareInstanceState'
,
host_sub
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
...
...
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