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
Eric Zheng
slapos.core
Commits
5f74af39
Commit
5f74af39
authored
Oct 10, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup the cache key.
parent
2be40203
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+5
-3
No files found.
master/product/Vifib/Tool/SlapTool.py
View file @
5f74af39
...
@@ -162,7 +162,8 @@ class SlapTool(BaseTool):
...
@@ -162,7 +162,8 @@ class SlapTool(BaseTool):
return
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_computer
)
return
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_computer
)
def
_fillComputerInformationCache
(
self
,
computer_id
,
user
,
full
):
def
_fillComputerInformationCache
(
self
,
computer_id
,
user
,
full
):
self
.
_getCachePlugin
().
set
(
user
,
DEFAULT_CACHE_SCOPE
,
key
=
'%s_%s_%s'
%
(
full
,
computer_id
,
user
)
self
.
_getCachePlugin
().
set
(
key
,
DEFAULT_CACHE_SCOPE
,
dict
(
dict
(
time
=
time
.
time
(),
time
=
time
.
time
(),
data
=
self
.
_getCacheComputerInformation
(
computer_id
,
user
,
full
),
data
=
self
.
_getCacheComputerInformation
(
computer_id
,
user
,
full
),
...
@@ -193,7 +194,7 @@ class SlapTool(BaseTool):
...
@@ -193,7 +194,7 @@ class SlapTool(BaseTool):
return
entry
return
entry
def
_activateFillComputerInformationCache
(
self
,
computer_id
,
user
,
full
):
def
_activateFillComputerInformationCache
(
self
,
computer_id
,
user
,
full
):
tag
=
'computer_information_cache_fill_%s
'
%
user
tag
=
'computer_information_cache_fill_%s
_%s_%s'
%
(
computer_id
,
user
,
full
)
if
self
.
getPortalObject
().
portal_activities
.
countMessageWithTag
(
tag
)
==
0
:
if
self
.
getPortalObject
().
portal_activities
.
countMessageWithTag
(
tag
)
==
0
:
self
.
activate
(
activity
=
'SQLQueue'
,
tag
=
tag
).
_fillComputerInformationCache
(
self
.
activate
(
activity
=
'SQLQueue'
,
tag
=
tag
).
_fillComputerInformationCache
(
computer_id
,
user
,
full
)
computer_id
,
user
,
full
)
...
@@ -211,7 +212,8 @@ class SlapTool(BaseTool):
...
@@ -211,7 +212,8 @@ class SlapTool(BaseTool):
if
not
self
.
_isTestRun
():
if
not
self
.
_isTestRun
():
cache_plugin
=
self
.
_getCachePlugin
()
cache_plugin
=
self
.
_getCachePlugin
()
try
:
try
:
entry
=
cache_plugin
.
get
(
user
,
DEFAULT_CACHE_SCOPE
)
key
=
'%s_%s_%s'
(
full
,
computer_id
,
user
)
entry
=
cache_plugin
.
get
(
key
,
DEFAULT_CACHE_SCOPE
)
except
KeyError
:
except
KeyError
:
entry
=
None
entry
=
None
if
entry
is
not
None
and
type
(
entry
.
getValue
())
==
type
({}):
if
entry
is
not
None
and
type
(
entry
.
getValue
())
==
type
({}):
...
...
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