grandlyon: handle missing media/ directory when copying portals

wip/shot-and-diff
Frédéric Péters 3 years ago
parent d3b9a8e525
commit 0613710ef3

@ -25,5 +25,6 @@ open('/tmp/site-export.json', 'w').write(site_export)
subprocess.call(['sudo', '-u', 'combo', 'combo-manage', 'tenant_command', 'import_site', '-d', dest_site, '/tmp/site-export.json'])
subprocess.call(['sudo', '-u', 'combo', 'combo-manage', 'tenant_command', 'runscript', '-d', dest_site, 'fsck-combo.py'])
if os.listdir('/var/lib/combo/tenants/%s/media/*' % orig_site):
subprocess.call(['sudo', '-u', 'combo', 'cp', '-ar', '/var/lib/combo/tenants/%s/media' % orig_site, '/var/lib/combo/tenants/%s/' % dest_site])
orig_media_dir = '/var/lib/combo/tenants/%s/media/*' % orig_site
if os.path.exists(orig_media_dir) and os.listdir(orig_media_dir):
subprocess.call(['sudo', '-u', 'combo', 'cp', '-ar', orig_media_dir, '/var/lib/combo/tenants/%s/' % dest_site])

@ -25,5 +25,6 @@ open('/tmp/site-export.json', 'w').write(site_export)
subprocess.call(['sudo', '-u', 'combo', 'combo-manage', 'tenant_command', 'import_site', '-d', dest_site, '/tmp/site-export.json'])
subprocess.call(['sudo', '-u', 'combo', 'combo-manage', 'tenant_command', 'runscript', '-d', dest_site, 'fsck-combo.py'])
if os.listdir('/var/lib/combo/tenants/%s/media/' % orig_site):
subprocess.call(['sudo', '-u', 'combo', 'cp', '-ar', '/var/lib/combo/tenants/%s/media' % orig_site, '/var/lib/combo/tenants/%s/' % dest_site])
orig_media_dir = '/var/lib/combo/tenants/%s/media/*' % orig_site
if os.path.exists(orig_media_dir) and os.listdir(orig_media_dir):
subprocess.call(['sudo', '-u', 'combo', 'cp', '-ar', orig_media_dir, '/var/lib/combo/tenants/%s/' % dest_site])

Loading…
Cancel
Save