Using python to do this might have made sense in 2011, but it doesn't now.
Our hand is forced here, because systems are no longer guaranteed to
have an executable called "python".
For background details on why this is happening, see
https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3#.2Fusr.2Fbin.2Fpython
Signed-off-by: Nathan Cutler <ncutler@suse.com>
"""
remote.run(
args=[
- 'python',
- '-c',
- 'import shutil, sys; shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))',
+ 'cat',
+ run.Raw('>'),
path,
],
stdin=data,
remote.run(
args=[
'sudo',
- 'python',
+ 'sh',
'-c',
- 'import shutil, sys; shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))',
- path,
+ 'cat > ' + path,
] + owner_args + permargs,
stdin=data,
)