rundaca2: if file upload fails, retry
This commit is contained in:
parent
d18e8466a9
commit
a1df585ec1
|
@ -39,6 +39,8 @@ def daca2report(reportfolder):
|
||||||
def upload(localfolder, webfolder):
|
def upload(localfolder, webfolder):
|
||||||
if len(PASSWORD) < 3:
|
if len(PASSWORD) < 3:
|
||||||
return
|
return
|
||||||
|
tries = 1
|
||||||
|
while tries <= 5:
|
||||||
try:
|
try:
|
||||||
child = pexpect.spawn(
|
child = pexpect.spawn(
|
||||||
'scp -r ' + localfolder + ' danielmarjamaki,cppcheck@web.sf.net:htdocs/' + webfolder)
|
'scp -r ' + localfolder + ' danielmarjamaki,cppcheck@web.sf.net:htdocs/' + webfolder)
|
||||||
|
@ -46,8 +48,11 @@ def upload(localfolder, webfolder):
|
||||||
child.expect('Password:')
|
child.expect('Password:')
|
||||||
child.sendline(PASSWORD)
|
child.sendline(PASSWORD)
|
||||||
child.interact()
|
child.interact()
|
||||||
except (IOError, OSError, pexpect.TIMEOUT):
|
return
|
||||||
pass
|
except (IOError, OSError, pexpect.TIMEOUT, pexpect.EOF):
|
||||||
|
print('Sleep for 10 seconds..')
|
||||||
|
time.sleep(10)
|
||||||
|
tries = tries + 1
|
||||||
|
|
||||||
|
|
||||||
def daca2(foldernum):
|
def daca2(foldernum):
|
||||||
|
|
Loading…
Reference in New Issue