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
Paul Graydon
slapos.core
Commits
e81734a0
Commit
e81734a0
authored
Oct 09, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Drop *_hasReportedError
parent
22aeb137
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
136 deletions
+2
-136
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareInstance_hasReportedError.py
...lapos_crm_monitoring/SoftwareInstance_hasReportedError.py
+0
-30
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareInstance_hasReportedError.xml
...apos_crm_monitoring/SoftwareInstance_hasReportedError.xml
+0
-62
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+1
-43
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list_error_reported.xml
...eReport/my_busy_compute_partition_list_error_reported.xml
+1
-1
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareInstance_hasReportedError.py
deleted
100644 → 0
View file @
22aeb137
from
DateTime
import
DateTime
if
context
.
getAggregateValue
(
portal_type
=
"Compute Partition"
)
is
not
None
:
d
=
context
.
getAccessStatus
()
# Ignore if data isn't present.
if
d
.
get
(
"no_data"
,
None
)
==
1
:
if
include_message
:
return
"Not possible to connect"
return
result
=
d
[
'text'
]
last_contact
=
DateTime
(
d
.
get
(
'created_at'
))
since
=
DateTime
(
d
.
get
(
'since'
))
if
result
.
startswith
(
'#error '
):
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
if
include_message
and
include_created_at
and
not
include_since
:
return
result
,
last_contact
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
deleted
100644 → 0
View file @
22aeb137
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
include_message=False, include_created_at=False, include_since=False, tolerance=0
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_hasReportedError
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
e81734a0
...
...
@@ -23,12 +23,11 @@
import
transaction
from
erp5.component.test.SlapOSTestCaseMixin
import
\
SlapOSTestCaseMixin
,
SlapOSTestCaseMixinWithAbort
,
TemporaryAlarmScript
,
PinnedDateTime
SlapOSTestCaseMixin
,
SlapOSTestCaseMixinWithAbort
,
TemporaryAlarmScript
from
Products.ERP5Type.tests.utils
import
FileUpload
import
os
from
DateTime
import
DateTime
from
App.Common
import
rfc1123_date
from
zExceptions
import
Unauthorized
...
...
@@ -231,47 +230,6 @@ class TestSlapOSisSupportRequestCreationClosed(TestCRMSkinsMixin):
# it dont close another project
self
.
assertFalse
(
self
.
other_project
.
Project_isSupportRequestCreationClosed
())
class
TestSlapOSHasError
(
SlapOSTestCaseMixin
):
def
test_SoftwareInstance_hasReportedError
(
self
):
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
"Software Instance"
,
reference
=
self
.
generateNewId
()
)
_
,
partition
=
self
.
_makeComputeNode
(
self
.
addProject
())
error_date
=
DateTime
()
-
0.1
with
PinnedDateTime
(
self
,
error_date
):
instance
.
setErrorStatus
(
""
)
self
.
assertEqual
(
instance
.
SoftwareInstance_hasReportedError
(),
None
)
instance
.
setAggregateValue
(
partition
)
self
.
assertEqual
(
str
(
instance
.
SoftwareInstance_hasReportedError
()),
'#error '
)
instance
.
setAccessStatus
(
""
)
self
.
assertEqual
(
instance
.
SoftwareInstance_hasReportedError
(),
None
)
def
test_SoftwareInstallation_hasReportedError
(
self
):
installation
=
self
.
portal
.
software_installation_module
.
newContent
(
reference
=
self
.
generateNewId
()
)
self
.
assertEqual
(
installation
.
SoftwareInstallation_hasReportedError
(),
None
)
error_date
=
DateTime
()
-
0.1
with
PinnedDateTime
(
self
,
error_date
):
installation
.
setErrorStatus
(
""
)
self
.
assertNotEqual
(
installation
.
SoftwareInstallation_hasReportedError
(),
None
)
self
.
assertEqual
(
rfc1123_date
(
installation
.
SoftwareInstallation_hasReportedError
()),
rfc1123_date
(
error_date
))
installation
.
setBuildingStatus
(
""
)
self
.
assertEqual
(
installation
.
SoftwareInstallation_hasReportedError
(),
None
)
class
TestCRMPropertySheetConstraint
(
SlapOSTestCaseMixin
):
def
afterSetUp
(
self
):
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list_error_reported.xml
View file @
e81734a0
...
...
@@ -113,7 +113,7 @@
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: cell.getAggregateRelatedValue(portal_type="Software Instance").SoftwareInstance_
hasReportedError(include_message=True, )
</string>
</value>
<value>
<string>
python: cell.getAggregateRelatedValue(portal_type="Software Instance").SoftwareInstance_
getReportedErrorDict()[\'message\']
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
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