Commit 77f69dbc authored by Jérome Perrin's avatar Jérome Perrin

make sure command executed exits without error


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23608 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e8cce2a5
...@@ -14,12 +14,14 @@ if os.environ.get('erp5_load_data_fs'): ...@@ -14,12 +14,14 @@ if os.environ.get('erp5_load_data_fs'):
else: else:
Storage = DemoStorage(base=FileStorage(new_data_fs_path), quota=(1<<20)) Storage = DemoStorage(base=FileStorage(new_data_fs_path), quota=(1<<20))
print("Restoring MySQL database ... ") print("Restoring MySQL database ... ")
os.system("mysql %s < %s/dump.sql" % (getMySQLArguments(), instance_home)) assert os.system("mysql %s < %s/dump.sql" % (
getMySQLArguments(), instance_home)) == 0
print("Restoring static files ... ") print("Restoring static files ... ")
for dir in ('Constraint', 'Document', 'PropertySheet'): for dir in ('Constraint', 'Document', 'PropertySheet'):
if os.path.exists('%s/%s.bak' % (instance_home, dir)): if os.path.exists('%s/%s.bak' % (instance_home, dir)):
os.system('rm -rf %s/%s' % (instance_home, dir)) assert os.system('rm -rf %s/%s' % (instance_home, dir)) == 0
os.system('cp -ar %s/%s.bak %s/%s' % (instance_home, dir, instance_home, dir)) assert os.system('cp -ar %s/%s.bak %s/%s' % (
instance_home, dir, instance_home, dir)) == 0
elif os.environ.get('erp5_save_data_fs'): elif os.environ.get('erp5_save_data_fs'):
if os.path.exists(new_data_fs_path): if os.path.exists(new_data_fs_path):
os.remove(new_data_fs_path) os.remove(new_data_fs_path)
......
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