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
81c4585a
Commit
81c4585a
authored
Jan 03, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: More accurate checks when recheck the Support Reuest Monitoring State
parent
9bd2ad5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_recheckMonitoring.py
...slapos_crm_monitoring/SupportRequest_recheckMonitoring.py
+15
-4
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_recheckMonitoring.py
View file @
81c4585a
...
...
@@ -16,10 +16,13 @@ document = context.getAggregateValue()
if
document
is
None
:
return
True
aggregate_portal_type
=
document
.
getPortalType
()
memcached_dict
=
context
.
Base_getSlapToolMemcachedDict
()
if
aggregate_portal_type
==
"Computer"
:
if
document
.
getMonitorScope
()
==
"disabled"
:
return
"Monitor is disabled to the related %s."
%
document
.
getPortalType
()
try
:
d
=
memcached_dict
[
document
.
getReference
()]
d
=
json
.
loads
(
d
)
...
...
@@ -33,6 +36,9 @@ if aggregate_portal_type == "Computer":
if
aggregate_portal_type
==
"Software Installation"
:
computer_title
=
document
.
getAggregateTitle
()
if
document
.
getAggregateValue
().
getMonitorScope
()
==
"disabled"
:
return
"Monitor is disabled to the related %s."
%
document
.
getPortalType
()
if
document
.
getSlapState
()
not
in
[
"start_requested"
,
"stop_requested"
]:
return
"Software Installation is Destroyed."
...
...
@@ -55,6 +61,9 @@ if aggregate_portal_type == "Software Installation":
if
aggregate_portal_type
==
"Hosting Subscription"
:
if
document
.
getMonitorScope
()
==
"disabled"
:
return
"Monitor is disabled to the related %s."
%
document
.
getPortalType
()
message_list
=
[]
hosting_subscription
=
document
...
...
@@ -69,17 +78,19 @@ if aggregate_portal_type == "Hosting Subscription":
if
instance
.
getAggregate
()
is
not
None
:
computer
=
instance
.
getAggregateValue
().
getParentValue
()
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
computer
.
getAllocationScope
()
in
[
"open/public"
,
"open/friend"
]
and
\
computer
.
getAllocationScope
()
in
[
"open/public"
,
"open/friend"
,
"open/subscription"
]
and
\
instance
.
getSlapState
()
==
"start_requested"
and
\
instance
.
SoftwareInstance_hasReportedError
():
message_list
.
append
(
"%s has error (%s, %s at %s scope %s)"
%
(
instance
.
getReference
(),
instance
.
getTitle
(),
instance
.
getUrlString
(),
computer
.
getReference
(),
computer
.
getAllocationScope
()))
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
computer
.
getAllocationScope
()
in
[
"closed/outdated"
,
"open/personal"
]:
message_list
.
append
(
"%s on a %s computer"
%
(
instance
,
computer
.
getAllocationScope
())
)
computer
.
getAllocationScope
()
in
[
"closed/outdated"
,
"open/personal"
]
and
\
instance
.
getSlapState
()
==
"start_requested"
and
\
instance
.
SoftwareInstance_hasReportedError
():
message_list
.
append
(
"%s on a %s computer"
%
(
instance
.
getReference
(),
computer
.
getAllocationScope
())
)
else
:
message_list
.
append
(
"%s is not allocated"
%
instance
)
message_list
.
append
(
"%s is not allocated"
%
instance
.
getReference
()
)
return
","
.
join
(
message_list
)
return
None
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