Skip to content

Commit

Permalink
Make --diff lines of context configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
gechr committed Feb 19, 2016
1 parent f9526b2 commit bbc855c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/ansible/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ def load_config_file():
COLOR_DIFF_REMOVE = get_config(p, 'colors', 'diff_remove', 'ANSIBLE_COLOR_DIFF_REMOVE', 'red')
COLOR_DIFF_LINES = get_config(p, 'colors', 'diff_lines', 'ANSIBLE_COLOR_DIFF_LINES', 'cyan')

# diff
DIFF_CONTEXT = get_config(p, 'diff', 'context', 'ANSIBLE_DIFF_CONTEXT', 3, integer=True)

# non-configurable things
MODULE_REQUIRE_ARGS = ['command', 'shell', 'raw', 'script']
MODULE_NO_JSON = ['command', 'shell', 'raw']
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/plugins/callback/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _get_diff(self, difflist):
tofile=after_header,
fromfiledate='',
tofiledate='',
n=10)
n=C.DIFF_CONTEXT)
has_diff = False
for line in differ:
has_diff = True
Expand Down

0 comments on commit bbc855c

Please sign in to comment.