From e97c082e9e05a2101b55cf7d155f1618edd31bfe Mon Sep 17 00:00:00 2001 From: Fredrik Unger Date: Wed, 6 Feb 2013 11:55:46 +0100 Subject: [PATCH] tools: fixed problem with local test 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. --- treecutter/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/treecutter/tools.py b/treecutter/tools.py index f294c61..a9c94a0 100644 --- a/treecutter/tools.py +++ b/treecutter/tools.py @@ -20,7 +20,10 @@ def publish(src,target): 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)+']' -- 2.30.2