Revision 72f0f7fd
ID | 72f0f7fd47340a74f51f37b6c0376f0b7a4fb9ea |
Parent | 4e5e8bfc |
Child | 8a23d2d3 |
Fix the ssh change which breaks remote ssh commands
Explanation: since we use lists and not a string, every argument we give
is passed unchanged to the remote shell. So, for example, passing
'/etc/init.d/ganeti restart' to the remote shell, it will try to run the
path /etc/init.d/ganeti\ restart. With the s space included. This
breaks, for example, gnt-node add and gnt-cluster command.
The original problem with the backup routines that led to the "'" change
is that they use a plain " ".join(list), but we don't need to quote the
whole ssh remote command for this. We can simply use the existing
utils.ShellQuoteCmd(list) which does the proper quoting of the ';' or
'&&' metacharacters.
With this change, both gnt-node add, gnt-cluster command and
export/import work.
This also improves the error-handling behaviour of one cat command by
making it conditional on the preceding mkdir.
Reviewed-by: ultrotter
Files
- added
- modified
- copied
- renamed
- deleted
- lib
- backend.py (diff)
- ssh.py (diff)