From eefb4931dd4e9489ff68aa332493e5ef2468d121 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 30 Nov 2015 09:16:33 -0800 Subject: [PATCH] allow for bad stdout return from make temp dir command fixes #13359 --- lib/ansible/plugins/action/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index fcbd1e2c21e..1ac8d79a410 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -1,5 +1,5 @@ # (c) 2012-2014, Michael DeHaan -# +/ # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify @@ -229,7 +229,11 @@ class ActionBase(with_metaclass(ABCMeta, object)): output = output + u": %s" % result['stdout'] raise AnsibleConnectionFailure(output) - rc = self._connection._shell.join_path(result['stdout'].strip(), u'').splitlines()[-1] + try: + rc = self._connection._shell.join_path(result['stdout'].strip(), u'').splitlines()[-1] + except IndexError: + # stdout was empty or just space, set to / to trigger error in next if + rc = '/' # Catch failure conditions, files should never be # written to locations in /.