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
Cédric Le Ninivin
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
Show 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 @@
...
@@ -8,14 +8,9 @@
from
DateTime
import
DateTime
from
DateTime
import
DateTime
import
json
import
json
from
Products.ERP5Type.DateUtils
import
addToDate
if
context
.
getSimulationState
()
==
"invalidated"
:
if
context
.
getSimulationState
()
==
"invalidated"
:
return
"Closed Ticket"
return
"Closed Ticket"
portal
=
context
.
getPortalObject
()
document
=
context
.
getAggregateValue
()
document
=
context
.
getAggregateValue
()
if
document
is
None
:
if
document
is
None
:
...
@@ -39,6 +34,29 @@ if aggregate_portal_type == "Computer":
...
@@ -39,6 +34,29 @@ if aggregate_portal_type == "Computer":
except
KeyError
:
except
KeyError
:
return
"No Contact Information"
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"
:
if
aggregate_portal_type
==
"Hosting Subscription"
:
message_list
=
[]
message_list
=
[]
hosting_subscription
=
document
hosting_subscription
=
document
...
@@ -46,17 +64,12 @@ if aggregate_portal_type == "Hosting Subscription":
...
@@ -46,17 +64,12 @@ if aggregate_portal_type == "Hosting Subscription":
software_instance_list
=
hosting_subscription
.
getSpecialiseRelatedValueList
(
software_instance_list
=
hosting_subscription
.
getSpecialiseRelatedValueList
(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
])
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
# Check if at least one software Instance is Allocated
for
instance
in
software_instance_list
:
for
instance
in
software_instance_list
:
if
instance
.
getSlapState
()
not
in
[
"start_requested"
,
"stop_requested"
]:
if
instance
.
getSlapState
()
not
in
[
"start_requested"
,
"stop_requested"
]:
continue
continue
if
instance
.
getAggregate
()
is
not
None
:
if
instance
.
getAggregate
()
is
not
None
:
has_newest_allocated_instance
=
True
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"
]
and
\
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_viewMonitoring/my_aggregate_title_list.xml
View file @
bbc1e712
...
@@ -106,6 +106,10 @@
...
@@ -106,6 +106,10 @@
<string>
Hosting Subscription
</string>
<string>
Hosting Subscription
</string>
<string>
Hosting Subscription
</string>
<string>
Hosting Subscription
</string>
</tuple>
</tuple>
<tuple>
<string>
Software Installation
</string>
<string>
Software Installation
</string>
</tuple>
</list>
</list>
</value>
</value>
</item>
</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