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
Ivan Tyagov
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()
...
@@ -16,10 +16,13 @@ document = context.getAggregateValue()
if
document
is
None
:
if
document
is
None
:
return
True
return
True
aggregate_portal_type
=
document
.
getPortalType
()
aggregate_portal_type
=
document
.
getPortalType
()
memcached_dict
=
context
.
Base_getSlapToolMemcachedDict
()
memcached_dict
=
context
.
Base_getSlapToolMemcachedDict
()
if
aggregate_portal_type
==
"Computer"
:
if
aggregate_portal_type
==
"Computer"
:
if
document
.
getMonitorScope
()
==
"disabled"
:
return
"Monitor is disabled to the related %s."
%
document
.
getPortalType
()
try
:
try
:
d
=
memcached_dict
[
document
.
getReference
()]
d
=
memcached_dict
[
document
.
getReference
()]
d
=
json
.
loads
(
d
)
d
=
json
.
loads
(
d
)
...
@@ -33,6 +36,9 @@ if aggregate_portal_type == "Computer":
...
@@ -33,6 +36,9 @@ if aggregate_portal_type == "Computer":
if
aggregate_portal_type
==
"Software Installation"
:
if
aggregate_portal_type
==
"Software Installation"
:
computer_title
=
document
.
getAggregateTitle
()
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"
]:
if
document
.
getSlapState
()
not
in
[
"start_requested"
,
"stop_requested"
]:
return
"Software Installation is Destroyed."
return
"Software Installation is Destroyed."
...
@@ -55,6 +61,9 @@ if aggregate_portal_type == "Software Installation":
...
@@ -55,6 +61,9 @@ if aggregate_portal_type == "Software Installation":
if
aggregate_portal_type
==
"Hosting Subscription"
:
if
aggregate_portal_type
==
"Hosting Subscription"
:
if
document
.
getMonitorScope
()
==
"disabled"
:
return
"Monitor is disabled to the related %s."
%
document
.
getPortalType
()
message_list
=
[]
message_list
=
[]
hosting_subscription
=
document
hosting_subscription
=
document
...
@@ -69,17 +78,19 @@ if aggregate_portal_type == "Hosting Subscription":
...
@@ -69,17 +78,19 @@ if aggregate_portal_type == "Hosting Subscription":
if
instance
.
getAggregate
()
is
not
None
:
if
instance
.
getAggregate
()
is
not
None
:
computer
=
instance
.
getAggregateValue
().
getParentValue
()
computer
=
instance
.
getAggregateValue
().
getParentValue
()
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
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
.
getSlapState
()
==
"start_requested"
and
\
instance
.
SoftwareInstance_hasReportedError
():
instance
.
SoftwareInstance_hasReportedError
():
message_list
.
append
(
"%s has error (%s, %s at %s scope %s)"
%
(
instance
.
getReference
(),
instance
.
getTitle
(),
message_list
.
append
(
"%s has error (%s, %s at %s scope %s)"
%
(
instance
.
getReference
(),
instance
.
getTitle
(),
instance
.
getUrlString
(),
computer
.
getReference
(),
instance
.
getUrlString
(),
computer
.
getReference
(),
computer
.
getAllocationScope
()))
computer
.
getAllocationScope
()))
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
computer
.
getAllocationScope
()
in
[
"closed/outdated"
,
"open/personal"
]:
computer
.
getAllocationScope
()
in
[
"closed/outdated"
,
"open/personal"
]
and
\
message_list
.
append
(
"%s on a %s computer"
%
(
instance
,
computer
.
getAllocationScope
())
)
instance
.
getSlapState
()
==
"start_requested"
and
\
instance
.
SoftwareInstance_hasReportedError
():
message_list
.
append
(
"%s on a %s computer"
%
(
instance
.
getReference
(),
computer
.
getAllocationScope
())
)
else
:
else
:
message_list
.
append
(
"%s is not allocated"
%
instance
)
message_list
.
append
(
"%s is not allocated"
%
instance
.
getReference
()
)
return
","
.
join
(
message_list
)
return
","
.
join
(
message_list
)
return
None
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