hobo: handle theme overlays as in hobo-agent (#20272)
This commit is contained in:
parent
dbfd4179f4
commit
dff62a8cb7
|
@ -186,9 +186,17 @@ class CmdCheckHobos(Command):
|
|||
atomic_symlink(target_dir, theme_dir)
|
||||
for component in ('static', 'templates'):
|
||||
component_dir = os.path.join(tenant_dir, component)
|
||||
if os.path.lexists(component_dir):
|
||||
os.unlink(component_dir)
|
||||
if theme_data.get('overlay'):
|
||||
if not os.path.islink(component_dir) and os.path.isdir(component_dir):
|
||||
try:
|
||||
os.rmdir(component_dir)
|
||||
except OSError:
|
||||
continue
|
||||
if not theme_data.get('overlay'):
|
||||
try:
|
||||
os.unlink(component_dir)
|
||||
except OSError:
|
||||
pass
|
||||
else:
|
||||
atomic_symlink(
|
||||
os.path.join(self.THEMES_DIRECTORY, theme_data['overlay'], component),
|
||||
component_dir)
|
||||
|
|
Loading…
Reference in New Issue