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
bbc1e712
Commit
bbc1e712
authored
Mar 27, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Display correct information when the ticket is related to Software Installation
parent
2c614cd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_recheckMonitoring.py
...slapos_crm_monitoring/SupportRequest_recheckMonitoring.py
+25
-12
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_viewMonitoring/my_aggregate_title_list.xml
...SupportRequest_viewMonitoring/my_aggregate_title_list.xml
+4
-0
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_recheckMonitoring.py
View file @
bbc1e712
...
...
@@ -8,14 +8,9 @@
from
DateTime
import
DateTime
import
json
from
Products.ERP5Type.DateUtils
import
addToDate
if
context
.
getSimulationState
()
==
"invalidated"
:
return
"Closed Ticket"
portal
=
context
.
getPortalObject
()
document
=
context
.
getAggregateValue
()
if
document
is
None
:
...
...
@@ -39,6 +34,29 @@ if aggregate_portal_type == "Computer":
except
KeyError
:
return
"No Contact Information"
if
aggregate_portal_type
==
"Software Installation"
:
computer_title
=
document
.
getAggregateTitle
()
if
document
.
getSlapState
()
not
in
[
"start_requested"
,
"stop_requested"
]:
return
"Software Installation is Destroyed."
try
:
d
=
memcached_dict
[
document
.
getReference
()]
d
=
json
.
loads
(
d
)
last_contact
=
DateTime
(
d
.
get
(
'created_at'
))
if
d
.
get
(
"text"
).
startswith
(
"building"
):
return
"The software release %s is building for mode them 12 hours on %s, started on %s"
%
\
(
document
.
getUrlString
(),
computer_title
,
document
.
getCreationDate
())
elif
d
.
get
(
"text"
).
startswith
(
"#access"
):
return
"All OK, software built."
elif
d
.
get
(
"text"
).
startswith
(
"#error"
):
return
"The software release %s is failing to build for too long on %s, started on %s"
%
\
(
document
.
getUrlString
(),
computer_title
,
document
.
getCreationDate
())
except
KeyError
:
return
"The software release %s did not started to build on %s since %s"
%
\
(
document
.
getUrlString
(),
computer_title
,
document
.
getCreationDate
())
if
aggregate_portal_type
==
"Hosting Subscription"
:
message_list
=
[]
hosting_subscription
=
document
...
...
@@ -46,27 +64,22 @@ if aggregate_portal_type == "Hosting Subscription":
software_instance_list
=
hosting_subscription
.
getSpecialiseRelatedValueList
(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
])
has_newest_allocated_instance
=
False
has_unallocated_instance
=
False
failing_instance
=
None
# Check if at least one software Instance is Allocated
for
instance
in
software_instance_list
:
if
instance
.
getSlapState
()
not
in
[
"start_requested"
,
"stop_requested"
]:
continue
if
instance
.
getAggregate
()
is
not
None
:
has_newest_allocated_instance
=
True
computer
=
instance
.
getAggregateValue
().
getParentValue
()
if
instance
.
getPortalType
()
==
"Software Instance"
and
\
computer
.
getAllocationScope
()
in
[
"open/public"
,
"open/friend"
]
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
(),
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"
]:
computer
.
getAllocationScope
()
in
[
"closed/outdated"
,
"open/personal"
]:
message_list
.
append
(
"%s on a %s computer"
%
(
instance
,
computer
.
getAllocationScope
())
)
else
:
message_list
.
append
(
"%s is not allocated"
%
instance
)
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_viewMonitoring/my_aggregate_title_list.xml
View file @
bbc1e712
...
...
@@ -106,6 +106,10 @@
<string>
Hosting Subscription
</string>
<string>
Hosting Subscription
</string>
</tuple>
<tuple>
<string>
Software Installation
</string>
<string>
Software Installation
</string>
</tuple>
</list>
</value>
</item>
...
...
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