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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
58419b68
Commit
58419b68
authored
Jan 09, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Define 30 days tolerance before create a ticket for the hosting subscription
parent
fcec90a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/HostingSubscription_checkSoftwareInstanceState.py
...itoring/HostingSubscription_checkSoftwareInstanceState.py
+1
-1
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareInstance_hasReportedError.py
...lapos_crm_monitoring/SoftwareInstance_hasReportedError.py
+11
-6
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareInstance_hasReportedError.xml
...apos_crm_monitoring/SoftwareInstance_hasReportedError.xml
+1
-1
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/HostingSubscription_checkSoftwareInstanceState.py
View file @
58419b68
...
...
@@ -40,7 +40,7 @@ for instance in software_instance_list:
has_newest_allocated_instance
=
True
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
computer_partition
.
getParentValue
().
getMonitorScope
()
==
"enabled"
and
\
instance
.
SoftwareInstance_hasReportedError
():
instance
.
SoftwareInstance_hasReportedError
(
tolerance
=
30
):
return
context
.
HostingSubscription_createSupportRequestEvent
(
instance
,
'slapos-crm-hosting-subscription-instance-state.notification'
)
else
:
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareInstance_hasReportedError.py
View file @
58419b68
...
...
@@ -13,18 +13,23 @@ if context.getAggregateValue(portal_type="Computer Partition") is not None:
d
=
json
.
loads
(
d
)
result
=
d
[
'text'
]
last_contact
=
DateTime
(
d
.
get
(
'created_at'
))
since
=
DateTime
(
d
.
get
(
'since'
))
# Optimise by checking memcache information first.
if
result
.
startswith
(
'#error '
):
if
include_created_at
:
return
result
,
last_contact
return
result
if
((
DateTime
()
-
since
)
*
24
*
60
)
>
tolerance
:
if
include_created_at
and
not
include_since
:
return
result
,
last_contact
elif
include_created_at
and
include_since
:
return
result
,
last_contact
,
since
return
result
# XXX time limit of 48 hours for run at least once.
if
include_message
and
include_created_at
:
if
include_message
and
include_created_at
and
not
include_since
:
return
result
,
last_contact
if
include_message
and
not
include_created_at
:
elif
include_message
and
include_created_at
and
include_since
:
return
result
,
last_contact
,
since
elif
include_message
and
not
include_created_at
:
return
result
return
None
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareInstance_hasReportedError.xml
View file @
58419b68
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
include_message=False, include_created_at=False
</string>
</value>
<value>
<string>
include_message=False, include_created_at=False
, include_since=False, tolerance=0
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
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