Fixing some small bugs related to integration tests (v2)

This commit is contained in:
James Cammarata 2015-06-01 16:41:52 -05:00
parent 816b20af0b
commit 4bc7703db3
12 changed files with 81 additions and 39 deletions

View file

@ -588,8 +588,8 @@ class AnsibleModule(object):
return True
rc = selinux.lsetfilecon(self._to_filesystem_str(path),
str(':'.join(new_context)))
except OSError:
self.fail_json(path=path, msg='invalid selinux context', new_context=new_context, cur_context=cur_context, input_was=context)
except OSError, e:
self.fail_json(path=path, msg='invalid selinux context: %s' % str(e), new_context=new_context, cur_context=cur_context, input_was=context)
if rc != 0:
self.fail_json(path=path, msg='set selinux context failed')
changed = True