Commit 24c9d96c authored by Rafael Monnerat's avatar Rafael Monnerat

If update suceeded once, it is not required to repeat the command anymore.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44086 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ed75e1a1
......@@ -31,7 +31,9 @@ def updateMysql(args):
mysql_command_list = args[0]
mysql_script = args[1]
sleep = 30
is_succeed = False
while True:
if not is_succeed:
mysql = subprocess.Popen(mysql_command_list, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
result = mysql.communicate(mysql_script)[0]
......@@ -41,5 +43,6 @@ def updateMysql(args):
print 'Script failed with: %s' % result
print 'Sleeping for %ss and retrying' % sleep
else:
is_succeed = True
print 'Script succesfully run on database, exiting'
time.sleep(sleep)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment