# using dict for exit\_json and fail\_json, considering add\_path\_info and keys path/dest

**URL:** <https://forum.ansible.com/t/using-dict-for-exit-json-and-fail-json-considering-add-path-info-and-keys-path-dest/12162>\
**Category:** Ansible Project\
**Created:** [December 25, 2012, 3:40pm UTC](https://forum.ansible.com/t/using-dict-for-exit-json-and-fail-json-considering-add-path-info-and-keys-path-dest/12162 "2012-12-25T15:40:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.chanial](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@david.chanial](https://forum.ansible.com/u/david.chanial)\
**Post date:** [December 25, 2012, 3:40pm UTC](https://forum.ansible.com/t/using-dict-for-exit-json-and-fail-json-considering-add-path-info-and-keys-path-dest/12162/1 "2012-12-25T15:40:31Z")

</div>

Hi,

About, [#1788](https://github.com/ansible/ansible/issues/1788)  
I’m now using a dict in order to pass/update variables across functions.  
(Like args/kwargs in many modules like “mount”).

but i have a question :

[https://github.com/ansible/ansible/blob/devel/lib/ansible/module\_common.py#L604](https://github.com/ansible/ansible/blob/devel/lib/ansible/module_common.py#L604)  
def exit\_json(self, \*\*kwargs):  
def fail\_json(self, \*\*kwargs):

Thoses functions take a second parameter '\*\*kwargs) and call :  
self.add\_path\_info(kwargs)

Which do (just a part) :  
def add\_path\_info(self, kwargs):  
path = kwargs.get(‘path’, kwargs.get(‘dest’, None))  
if path is None:  
return kwargs

Must module developer HAVE TO not use “path” or “dest” key if is not wanted that state, mode, owner, etc to be added to kwargs dict ?

Or should we can think a way to disable this automatic treatment if not wanted ?

Thanks for your time.
