hobo deploy: always look for a default.zip skeleton (#64784)

This commit is contained in:
Frédéric Péters 2022-05-04 21:57:35 +02:00
parent 0da50a984b
commit f167d06ac6
1 changed files with 5 additions and 3 deletions

View File

@ -162,13 +162,15 @@ class CmdCheckHobos(Command):
print('initializing instance in', tenant_app_dir)
os.mkdir(tenant_app_dir)
pub.set_tenant_by_hostname(self.get_instance_path(service.get('base_url')))
skeleton_filenames = ['default.zip']
if service.get('template_name'):
skeleton_filepath = os.path.join(
global_app_dir, 'skeletons', service.get('template_name')
)
skeleton_filenames.append(service.get('template_name'))
for skeleton_filename in reversed(skeleton_filenames):
skeleton_filepath = os.path.join(global_app_dir, 'skeletons', skeleton_filename)
if os.path.exists(skeleton_filepath):
with open(skeleton_filepath, 'rb') as fd:
pub.import_zip(fd)
break
new_site = True
else: