The ssh_cmd needed a host to do the command, but for local tests
a host is not availible. Test for host and if not availible run locally.
rsync does not need that check.
def ssh_cmd(target, command):
t = target.split(":")
c = command.split()
- cmd = ["ssh",t[0],c[0],c[1],t[1]]
+ if len(t)==1:
+ cmd = [c[0],c[1],t[0]]
+ else:
+ cmd = ["ssh",t[0],c[0],c[1],t[1]]
retcode = subprocess.call(cmd)
if retcode:
print 'Error: '+' '.join(cmd)+' Returncode ['+str(retcode)+']'