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
f904129e
Commit
f904129e
authored
Jan 07, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SlapTool: Store since when the logged information is there.
parent
390480e4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
21 deletions
+112
-21
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+76
-1
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.xml
...teItem/portal_components/test.erp5.testSlapOSSlapTool.xml
+17
-16
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+19
-4
No files found.
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
f904129e
This diff is collapsed.
Click to expand it.
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.xml
View file @
f904129e
...
...
@@ -46,22 +46,22 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 2
8
, 10: Use of eval (eval-used)
</string>
<string>
W:5
29
, 13: Use of eval (eval-used)
</string>
<string>
W:5
80
, 13: Use of eval (eval-used)
</string>
<string>
W:8
05
, 13: Use of eval (eval-used)
</string>
<string>
W:14
22
, 13: Use of eval (eval-used)
</string>
<string>
W:15
35
, 13: Use of eval (eval-used)
</string>
<string>
W:1
589
, 13: Use of eval (eval-used)
</string>
<string>
W:16
29
, 13: Use of eval (eval-used)
</string>
<string>
W:2
177
, 13: Use of eval (eval-used)
</string>
<string>
W:2
566
, 13: Use of eval (eval-used)
</string>
<string>
W:26
20
, 13: Use of eval (eval-used)
</string>
<string>
W:2
647
, 13: Use of eval (eval-used)
</string>
<string>
W:28
04
, 13: Use of eval (eval-used)
</string>
<string>
W:2
832
, 13: Use of eval (eval-used)
</string>
<string>
W:2
881
, 13: Use of eval (eval-used)
</string>
<string>
W:
2928
, 13: Use of eval (eval-used)
</string>
<string>
W: 2
7
, 10: Use of eval (eval-used)
</string>
<string>
W:5
40
, 13: Use of eval (eval-used)
</string>
<string>
W:5
95
, 13: Use of eval (eval-used)
</string>
<string>
W:8
36
, 13: Use of eval (eval-used)
</string>
<string>
W:14
61
, 13: Use of eval (eval-used)
</string>
<string>
W:15
78
, 13: Use of eval (eval-used)
</string>
<string>
W:1
636
, 13: Use of eval (eval-used)
</string>
<string>
W:16
76
, 13: Use of eval (eval-used)
</string>
<string>
W:2
239
, 13: Use of eval (eval-used)
</string>
<string>
W:2
640
, 13: Use of eval (eval-used)
</string>
<string>
W:26
98
, 13: Use of eval (eval-used)
</string>
<string>
W:2
725
, 13: Use of eval (eval-used)
</string>
<string>
W:28
82
, 13: Use of eval (eval-used)
</string>
<string>
W:2
910
, 13: Use of eval (eval-used)
</string>
<string>
W:2
959
, 13: Use of eval (eval-used)
</string>
<string>
W:
3006
, 13: Use of eval (eval-used)
</string>
</tuple>
</value>
</item>
...
...
@@ -134,6 +134,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
...
...
master/product/Vifib/Tool/SlapTool.py
View file @
f904129e
...
...
@@ -863,10 +863,22 @@ class SlapTool(BaseTool):
def
_logAccess
(
self
,
user_reference
,
context_reference
,
text
):
memcached_dict
=
self
.
Base_getSlapToolMemcachedDict
()
previous
=
self
.
_getCachedAccessInfo
(
context_reference
)
created_at
=
rfc1123_date
(
DateTime
())
since
=
created_at
if
previous
is
not
None
:
previous_json
=
json
.
loads
(
previous
)
if
text
.
split
(
" "
)[
0
]
==
previous_json
.
get
(
"text"
,
""
).
split
(
" "
)[
0
]:
since
=
previous_json
.
get
(
"since"
,
previous_json
.
get
(
"created_at"
,
rfc1123_date
(
DateTime
())))
value
=
json
.
dumps
({
'user'
:
'%s'
%
user_reference
,
'created_at'
:
'%s'
%
rfc1123_date
(
DateTime
())
,
'created_at'
:
'%s'
%
created_at
,
'text'
:
'%s'
%
text
,
'since'
:
'%s'
%
since
})
memcached_dict
[
context_reference
]
=
value
...
...
@@ -1098,17 +1110,20 @@ class SlapTool(BaseTool):
def
_getAccessStatus
(
self
,
context_reference
):
d
=
self
.
_getCachedAccessInfo
(
context_reference
)
last_modified
=
rfc1123_date
(
DateTime
())
if
d
is
None
:
if
context_reference
is
None
:
d
=
{
"user"
:
"SlapOS Master"
,
'created_at'
:
'%s'
%
rfc1123_date
(
DateTime
()),
'created_at'
:
'%s'
%
last_modified
,
'since'
:
'%s'
%
last_modified
,
"text"
:
"#error no data found"
}
else
:
d
=
{
"user"
:
"SlapOS Master"
,
'created_at'
:
'%s'
%
rfc1123_date
(
DateTime
()),
'created_at'
:
'%s'
%
last_modified
,
'since'
:
'%s'
%
last_modified
,
"text"
:
"#error no data found for %s"
%
context_reference
}
# Prepare for xml marshalling
...
...
@@ -1123,7 +1138,7 @@ class SlapTool(BaseTool):
'public, max-age=60, stale-if-error=604800'
)
self
.
REQUEST
.
response
.
setHeader
(
'Vary'
,
'REMOTE_USER'
)
self
.
REQUEST
.
response
.
setHeader
(
'Last-Modified'
,
rfc1123_date
(
DateTime
())
)
self
.
REQUEST
.
response
.
setHeader
(
'Last-Modified'
,
last_modified
)
self
.
REQUEST
.
response
.
setHeader
(
'Content-Type'
,
'text/xml; charset=utf-8'
)
self
.
REQUEST
.
response
.
setBody
(
xml_marshaller
.
xml_marshaller
.
dumps
(
d
))
return
self
.
REQUEST
.
response
...
...
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