ansible/ansible — pull request #9432 by sean- (2014-10-28 00:15:20+00:00)
Title: Fix chroot connection type.

For reasons not fully understood, it is possible for os.path.normpath()
to return a path that contains more than one leading slash. There is
an assumption in connection_plugins/chroot's put_file() that there is only one leading slash after
os.path.normpath(), however the code for os.path.normpath() makes it
clear that two slashes are possible. To address this, change the order
in which the chroot(2)'ed path is constructed and normalize the result,
not the inputs to os.path.normpath(). Before:

PUT /tmp/tmpjNYchB TO /.ansible/tmp/ansible-tmp-1414452814.97-43623097496280/setup

with additional debugging:

out_path: //.ansible/tmp/ansible-tmp-1414453077.31-250891897990627/setup
normpath: //.ansible/tmp/ansible-tmp-1414453077.31-250891897990627/setup
in_path: /tmp/tmpagDDBL
self.chroot: '/mnt'
PUT /tmp/tmpagDDBL TO /.ansible/tmp/ansible-tmp-1414453077.31-250891897990627/setup

and after:

PUT /tmp/tmpheJAEY TO /mnt/.ansible/tmp/ansible-tmp-1414454933.62-231262699030276/setup