Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
0f1eb3cf
Commit
0f1eb3cf
authored
May 07, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better fix for serializing/deserializing cache plugins (v2)
parent
cd6d1f92
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
lib/ansible/plugins/cache/base.py
+0
-3
lib/ansible/plugins/cache/memcached.py
+6
-2
lib/ansible/plugins/cache/memory.py
+6
-2
lib/ansible/plugins/cache/redis.py
+5
-2
No files found.
lib/ansible/plugins/cache/base.py
View file @
0f1eb3cf
...
@@ -26,9 +26,6 @@ from six import add_metaclass
...
@@ -26,9 +26,6 @@ from six import add_metaclass
@add_metaclass
(
ABCMeta
)
@add_metaclass
(
ABCMeta
)
class
BaseCacheModule
:
class
BaseCacheModule
:
def
__init__
(
self
):
self
.
__getstate__
=
self
.
copy
@abstractmethod
@abstractmethod
def
get
(
self
,
key
):
def
get
(
self
,
key
):
pass
pass
...
...
lib/ansible/plugins/cache/memcached.py
View file @
0f1eb3cf
...
@@ -113,8 +113,6 @@ class CacheModuleKeys(collections.MutableSet):
...
@@ -113,8 +113,6 @@ class CacheModuleKeys(collections.MutableSet):
self
.
_cache
=
cache
self
.
_cache
=
cache
self
.
_keyset
=
dict
(
*
args
,
**
kwargs
)
self
.
_keyset
=
dict
(
*
args
,
**
kwargs
)
super
(
CacheModule
,
self
)
.
__init__
()
def
__contains__
(
self
,
key
):
def
__contains__
(
self
,
key
):
return
key
in
self
.
_keyset
return
key
in
self
.
_keyset
...
@@ -193,3 +191,9 @@ class CacheModule(BaseCacheModule):
...
@@ -193,3 +191,9 @@ class CacheModule(BaseCacheModule):
def
copy
(
self
):
def
copy
(
self
):
return
self
.
_keys
.
copy
()
return
self
.
_keys
.
copy
()
def
__getstate__
(
self
):
return
dict
()
def
__setstate__
(
self
,
data
):
self
.
__init__
()
lib/ansible/plugins/cache/memory.py
View file @
0f1eb3cf
...
@@ -24,8 +24,6 @@ class CacheModule(BaseCacheModule):
...
@@ -24,8 +24,6 @@ class CacheModule(BaseCacheModule):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
_cache
=
{}
self
.
_cache
=
{}
super
(
CacheModule
,
self
)
.
__init__
()
def
get
(
self
,
key
):
def
get
(
self
,
key
):
return
self
.
_cache
.
get
(
key
)
return
self
.
_cache
.
get
(
key
)
...
@@ -46,3 +44,9 @@ class CacheModule(BaseCacheModule):
...
@@ -46,3 +44,9 @@ class CacheModule(BaseCacheModule):
def
copy
(
self
):
def
copy
(
self
):
return
self
.
_cache
.
copy
()
return
self
.
_cache
.
copy
()
def
__getstate__
(
self
):
return
self
.
copy
()
def
__setstate__
(
self
,
data
):
self
.
_cache
=
data
lib/ansible/plugins/cache/redis.py
View file @
0f1eb3cf
...
@@ -51,8 +51,6 @@ class CacheModule(BaseCacheModule):
...
@@ -51,8 +51,6 @@ class CacheModule(BaseCacheModule):
self
.
_cache
=
StrictRedis
(
*
connection
)
self
.
_cache
=
StrictRedis
(
*
connection
)
self
.
_keys_set
=
'ansible_cache_keys'
self
.
_keys_set
=
'ansible_cache_keys'
super
(
CacheModule
,
self
)
.
__init__
()
def
_make_key
(
self
,
key
):
def
_make_key
(
self
,
key
):
return
self
.
_prefix
+
key
return
self
.
_prefix
+
key
...
@@ -103,3 +101,8 @@ class CacheModule(BaseCacheModule):
...
@@ -103,3 +101,8 @@ class CacheModule(BaseCacheModule):
ret
[
key
]
=
self
.
get
(
key
)
ret
[
key
]
=
self
.
get
(
key
)
return
ret
return
ret
def
__getstate__
(
self
):
return
dict
()
def
__setstate__
(
self
,
data
):
self
.
__init__
()
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