Projet

Général

Profil

0001-hobo_deploy-call-import-template-with-template_name-.patch

Benjamin Dauvergne, 16 janvier 2017 16:38

Télécharger (1,99 ko)

Voir les différences:

Subject: [PATCH] hobo_deploy: call import-template with template_name (#13154)

If the current project has an import-template command and the current service
has a template_name we call the first with the second as a parameter.
 hobo/agent/common/management/commands/hobo_deploy.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
hobo/agent/common/management/commands/hobo_deploy.py
9 9

  
10 10
from django.conf import settings
11 11
from django.core.management.base import BaseCommand, CommandError
12
from django.core.management import call_command
12
from django.core.management import call_command, get_commands
13 13

  
14 14
from hobo.multitenant.middleware import TenantMiddleware, TenantNotFound
15 15
from hobo.theme.utils import get_theme
......
98 98
        self.generate_saml_keys(tenant, prefix='sp-')
99 99
        self.configure_service_provider(hobo_environment, tenant)
100 100
        self.configure_theme(hobo_environment, tenant)
101
        self.configure_template(hobo_environment, tenant)
101 102

  
102 103
    def generate_saml_keys(self, tenant, prefix=''):
103 104

  
......
179 180
                target_dir = os.path.join(settings.THEMES_DIRECTORY,
180 181
                        theme.get('overlay'), part)
181 182
                atomic_symlink(target_dir, os.path.join(tenant_dir, part))
183

  
184
    def configure_template(self, hobo_environment, tenant):
185
        me = [x for x in hobo_environment.get('services') if x.get('this') is True][0]
186

  
187
        if 'import-template' in get_commands() and me.get('template_name'):
188
            call_command('import-template', me['template_name'])
182
-