Projet

Général

Profil

0001-hobo-handle-theme-overlays-as-in-hobo-agent-20272.patch

Thomas Noël, 24 novembre 2017 19:19

Télécharger (1,45 ko)

Voir les différences:

Subject: [PATCH] hobo: handle theme overlays as in hobo-agent (#20272)

 wcs/ctl/check_hobos.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
wcs/ctl/check_hobos.py
185 185
            atomic_symlink(target_dir, theme_dir)
186 186
            for component in ('static', 'templates'):
187 187
                component_dir = os.path.join(tenant_dir, component)
188
                if os.path.lexists(component_dir):
189
                    os.unlink(component_dir)
190
                if theme_data.get('overlay'):
188
                if not os.path.islink(component_dir) and os.path.isdir(component_dir):
189
                    try:
190
                        os.rmdir(component_dir)
191
                    except OSError:
192
                        continue
193
                if not theme_data.get('overlay'):
194
                    try:
195
                        os.unlink(component_dir)
196
                    except OSError:
197
                        pass
198
                else:
191 199
                    atomic_symlink(
192 200
                            os.path.join(self.THEMES_DIRECTORY, theme_data['overlay'], component),
193 201
                            component_dir)
194
-