summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-09 16:05:45 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-09 16:05:45 +0100
commite26f0fdc11f9190b6a015b420d3feae97274eaef (patch)
tree0ff24324ea077871da40b855c8ecb9ed9d0339a4
parent5946dcffc62624d73fc7037ac7d817600d458ab8 (diff)
Hack around strange change in ssh behaviour.
Before 16.04 as host OS, we would start a VM and then soon after ssh to it. This ssh would block while the VM got started then proceed normally. Now we get a "connection closed by remote host", so we have to ignore this and keep trying until the VM is up.
-rwxr-xr-xcdistvm13
1 files changed, 11 insertions, 2 deletions
diff --git a/cdistvm b/cdistvm
index e43ad82..e9e53a4 100755
--- a/cdistvm
+++ b/cdistvm
@@ -68,8 +68,17 @@ ports = { 'fedora-22-32': 2000,
'arch-64': 2004 }
vbox = subprocess.Popen('vboxheadless --startvm %s' % args.target, shell=True)
-time.sleep(10)
-command('ssh -p %d carl@localhost "rm -rf cdistvm /var/tmp/tmp*"' % ports[args.target])
+
+ok = False
+while ok == False:
+ time.sleep(10)
+ try:
+ command('ssh -p %d carl@localhost "rm -rf cdistvm /var/tmp/tmp*"' % ports[args.target])
+ ok = True
+ except Error as e:
+ print('Ignoring: %s' % e)
+ pass
+
command('ssh -p %d carl@localhost %s' % (ports[args.target], cdist_cmd))
if args.command in ['package', 'doxygen', 'manual', 'changelog', 'pot']:
tmp = tempfile.mkdtemp()