From: Fredrik Unger Date: Wed, 6 Feb 2013 10:55:46 +0000 (+0100) Subject: tools: fixed problem with local test X-Git-Url: https://source.tree.se/git?p=treecutter.git;a=commitdiff_plain;h=e97c082e9e05a2101b55cf7d155f1618edd31bfe 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. --- 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)+']'