Description of problem: createOrUpdatePath strips text file's contents off of newlines at the end. POSIX text files, however, must end with a newline. How reproducible: Deterministic Steps to Reproduce: In Python: client.system.config.createOrUpdatePath(session,<SYSID>,"/root/abc",False,{'contents': "test\n", 'owner': "root", 'group': "root", 'permissions': "644", 'binary': False}, 1) Returns: [...] 'sha256': '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' [...] Notice the checksum. Create a file with string "test" and newline (all sane text editors append it implicitly at the end of file). # wc -m <file> 5 <file> # sha256sum <file> f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2 <file> Notice this checksum differs. Create a file without the end of line (in Vim: ":set binary", ":set noeol", ":wq"). # wc -m a 4 a # sha256sum a 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 a Notice the file Saved on Satellite is actually the one without mandatory EOL at EOF. Expected results: The API call should append EOL at EOF in text mode or at least not remove it.
I think it's the xmlrpc library that trims endlines (trailing whitespaces). I think that was the reason for: https://github.com/spacewalkproject/spacewalk/commit/a532229630ff01b91807236b94016b9eca6200a5 I also think it's not Sat5 that trims the whitespaces in this case. However I'm ok investigate it. If it turns to be the xmlrpc library and we're not able to achieve desired behavior by its configuration, I'd tend to close this bug WONTFIX as we do not plan to replace the underlying xmlrpc library.
How about hard-coding the EOL at EOF for the text files then? (Just a proposal, it would mean behavior change and might not be worth it.)
Closing as dup - see discussion in 1423017 *** This bug has been marked as a duplicate of bug 1423017 ***