Revision 00003458 lib/backend.py
b/lib/backend.py | ||
---|---|---|
1022 | 1022 |
|
1023 | 1023 |
comprcmd = "gzip" |
1024 | 1024 |
|
1025 |
remotecmd = utils.BuildShellCmd("ssh -q -oStrictHostKeyChecking=yes" |
|
1026 |
" -oBatchMode=yes -oEscapeChar=none" |
|
1027 |
" %s 'mkdir -p %s; cat > %s/%s'", |
|
1028 |
dest_node, destdir, destdir, destfile) |
|
1025 |
destcmd = utils.BuildShellCmd("mkdir -p %s; cat > %s/%s", |
|
1026 |
destdir, destdir, destfile) |
|
1027 |
remotecmd = ssh.BuildSSHCmd(dest_node, 'root', destcmd) |
|
1028 |
|
|
1029 |
|
|
1029 | 1030 |
|
1030 | 1031 |
# all commands have been checked, so we're safe to combine them |
1031 |
command = '|'.join([expcmd, comprcmd, remotecmd])
|
|
1032 |
command = '|'.join([expcmd, comprcmd, ' '.join(remotecmd)])
|
|
1032 | 1033 |
|
1033 | 1034 |
result = utils.RunCmd(command) |
1034 | 1035 |
|
... | ... | |
1168 | 1169 |
if not os.path.exists(constants.LOG_OS_DIR): |
1169 | 1170 |
os.mkdir(constants.LOG_OS_DIR, 0750) |
1170 | 1171 |
|
1171 |
remotecmd = utils.BuildShellCmd("ssh -q -oStrictHostKeyChecking=yes" |
|
1172 |
" -oBatchMode=yes -oEscapeChar=none" |
|
1173 |
" %s 'cat %s'", src_node, src_image) |
|
1172 |
destcmd = utils.BuildShellCmd('cat %s', src_image) |
|
1173 |
remotecmd = ssh.BuildSSHCmd(src_node, 'root', destcmd) |
|
1174 | 1174 |
|
1175 | 1175 |
comprcmd = "gunzip" |
1176 | 1176 |
impcmd = utils.BuildShellCmd("(cd %s; %s -i %s -b %s -s %s &>%s)", |
... | ... | |
1178 | 1178 |
real_os_dev.dev_path, real_swap_dev.dev_path, |
1179 | 1179 |
logfile) |
1180 | 1180 |
|
1181 |
command = '|'.join([remotecmd, comprcmd, impcmd])
|
|
1181 |
command = '|'.join([' '.join(remotecmd), comprcmd, impcmd])
|
|
1182 | 1182 |
|
1183 | 1183 |
result = utils.RunCmd(command) |
1184 | 1184 |
|
Also available in: Unified diff