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
bd405169
Commit
bd405169
authored
Sep 05, 2015
by
Victor Costan
Committed by
James Cammarata
Sep 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12258: don't wrap None in UnsafeProxy.
parent
ac6f61ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/ansible/vars/__init__.py
+1
-1
lib/ansible/vars/unsafe_proxy.py
+3
-2
No files found.
lib/ansible/vars/__init__.py
View file @
bd405169
...
...
@@ -183,7 +183,7 @@ class VariableManager:
try
:
host_facts
=
self
.
_fact_cache
.
get
(
host
.
name
,
dict
())
for
k
in
host_facts
.
keys
():
if
not
isinstance
(
host_facts
[
k
],
UnsafeProxy
):
if
host_facts
[
k
]
is
not
None
and
not
isinstance
(
host_facts
[
k
],
UnsafeProxy
):
host_facts
[
k
]
=
UnsafeProxy
(
host_facts
[
k
])
all_vars
=
combine_vars
(
all_vars
,
host_facts
)
except
KeyError
:
...
...
lib/ansible/vars/unsafe_proxy.py
View file @
bd405169
...
...
@@ -72,6 +72,8 @@ class UnsafeProxy(object):
return
bool
(
object
.
__getattribute__
(
self
,
"_obj"
))
def
__str__
(
self
):
return
str
(
object
.
__getattribute__
(
self
,
"_obj"
))
def
__unicode__
(
self
):
return
unicode
(
object
.
__getattribute__
(
self
,
"_obj"
))
def
__repr__
(
self
):
return
repr
(
object
.
__getattribute__
(
self
,
"_obj"
))
...
...
@@ -89,7 +91,7 @@ class UnsafeProxy(object):
'__long__'
,
'__lshift__'
,
'__lt__'
,
'__mod__'
,
'__mul__'
,
'__ne__'
,
'__neg__'
,
'__oct__'
,
'__or__'
,
'__pos__'
,
'__pow__'
,
'__radd__'
,
'__rand__'
,
'__rdiv__'
,
'__rdivmod__'
,
'__reduce__'
,
'__reduce_ex__'
,
'__repr__'
,
'__reversed__'
,
'__rfloor
fiv__'
,
'__rlshift__'
,
'__rmod__'
,
'__repr__'
,
'__reversed__'
,
'__rfloor
div__'
,
'__rlshift__'
,
'__rmod__'
,
'__rmul__'
,
'__ror__'
,
'__rpow__'
,
'__rrshift__'
,
'__rshift__'
,
'__rsub__'
,
'__rtruediv__'
,
'__rxor__'
,
'__setitem__'
,
'__setslice__'
,
'__sub__'
,
'__truediv__'
,
'__xor__'
,
'next'
,
...
...
@@ -127,6 +129,5 @@ class UnsafeProxy(object):
except
KeyError
:
cache
[
obj
.
__class__
]
=
theclass
=
cls
.
_create_class_proxy
(
obj
.
__class__
)
ins
=
object
.
__new__
(
theclass
)
theclass
.
__init__
(
ins
,
obj
,
*
args
,
**
kwargs
)
return
ins
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