Fix circular import with unsafe_proxy, template, and vars

template/__init__.py imported unsafe_proxy from vars which caused
vars/__init__.py to load.  vars/__init__.py needed template/__init__.py
which caused issues.  Loading unsafe_proxy from another location fixes
that.
This commit is contained in:
Toshio Kuratomi 2017-04-26 15:09:36 -07:00
parent 914f8e4596
commit 1c05ed7951
12 changed files with 157 additions and 124 deletions

View file

@ -35,9 +35,9 @@ class CallbackModule(CallbackBase):
CALLBACK_NAME = 'oneline'
def _command_generic_msg(self, hostname, result, caption):
stdout = result.get('stdout','').replace('\n', '\\n')
stdout = result.get('stdout','').replace('\n', '\\n').replace('\r', '\\r')
if 'stderr' in result and result['stderr']:
stderr = result.get('stderr','').replace('\n', '\\n')
stderr = result.get('stderr','').replace('\n', '\\n').replace('\r', '\\r')
return "%s | %s | rc=%s | (stdout) %s (stderr) %s" % (hostname, caption, result.get('rc', -1), stdout, stderr)
else:
return "%s | %s | rc=%s | (stdout) %s" % (hostname, caption, result.get('rc', -1), stdout)