~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to setup/hosting.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-02 10:46:11 UTC
  • mfrom: (1.5.7)
  • Revision ID: package-import@ubuntu.com-20140202104611-c2tlt43ldklc28k4
Tags: 1.22.0+dfsg-1
* New upstream release.
* debian/copyright: Update to 1.0 copyright standard. Thanks Felix Gruber!
  (LP: #737343)

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
import os, time, sys, traceback, subprocess, urllib2, re, base64, httplib, shutil
11
11
from argparse import ArgumentParser, FileType
12
 
from subprocess import check_call
 
12
from subprocess import check_call, CalledProcessError
13
13
from tempfile import NamedTemporaryFile
14
14
from collections import OrderedDict
15
15
 
530
530
                break
531
531
        print ('Uploaded in', int(time.time() - start), 'seconds\n\n')
532
532
        sys.stdout.flush()
533
 
    check_call(['ssh', 'kovid@%s' % server, '/home/kovid/uploadFiles'])
 
533
    try:
 
534
        check_call(['ssh', 'kovid@%s' % server, '/home/kovid/uploadFiles'])
 
535
    except CalledProcessError as err:
 
536
        # fosshub is being a little flaky sshing into it is failing the first
 
537
        # time, needing a retry
 
538
        if err.returncode == 255:
 
539
            check_call(['ssh', 'kovid@%s' % server, '/home/kovid/uploadFiles'])
 
540
        else:
 
541
            raise
534
542
# }}}
535
543
 
536
544
# CLI {{{