Revision c92b310a lib/backend.py
b/lib/backend.py | ||
---|---|---|
42 | 42 |
from ganeti import ssconf |
43 | 43 |
|
44 | 44 |
|
45 |
def _GetSshRunner(): |
|
46 |
return ssh.SshRunner() |
|
47 |
|
|
48 |
|
|
45 | 49 |
def StartMaster(): |
46 | 50 |
"""Activate local node as master node. |
47 | 51 |
|
... | ... | |
197 | 201 |
if 'nodelist' in what: |
198 | 202 |
result['nodelist'] = {} |
199 | 203 |
for node in what['nodelist']: |
200 |
success, message = ssh.VerifyNodeHostname(node)
|
|
204 |
success, message = _GetSshRunner().VerifyNodeHostname(node)
|
|
201 | 205 |
if not success: |
202 | 206 |
result['nodelist'][node] = message |
203 | 207 |
return result |
... | ... | |
1188 | 1192 |
|
1189 | 1193 |
destcmd = utils.BuildShellCmd("mkdir -p %s && cat > %s/%s", |
1190 | 1194 |
destdir, destdir, destfile) |
1191 |
remotecmd = ssh.BuildSSHCmd(dest_node, constants.GANETI_RUNAS, destcmd) |
|
1192 |
|
|
1193 |
|
|
1195 |
remotecmd = _GetSshRunner().BuildCmd(dest_node, constants.GANETI_RUNAS, |
|
1196 |
destcmd) |
|
1194 | 1197 |
|
1195 | 1198 |
# all commands have been checked, so we're safe to combine them |
1196 | 1199 |
command = '|'.join([expcmd, comprcmd, utils.ShellQuoteArgs(remotecmd)]) |
... | ... | |
1331 | 1334 |
os.mkdir(constants.LOG_OS_DIR, 0750) |
1332 | 1335 |
|
1333 | 1336 |
destcmd = utils.BuildShellCmd('cat %s', src_image) |
1334 |
remotecmd = ssh.BuildSSHCmd(src_node, constants.GANETI_RUNAS, destcmd) |
|
1337 |
remotecmd = _GetSshRunner().BuildCmd(src_node, constants.GANETI_RUNAS, |
|
1338 |
destcmd) |
|
1335 | 1339 |
|
1336 | 1340 |
comprcmd = "gunzip" |
1337 | 1341 |
impcmd = utils.BuildShellCmd("(cd %s; %s -i %s -b %s -s %s &>%s)", |
Also available in: Unified diff