Projet

Général

Profil

0001-agent-a2-prevent-useless-thread-launching-34484.patch

Benjamin Dauvergne, 02 juillet 2019 11:39

Télécharger (1,34 ko)

Voir les différences:

Subject: [PATCH] agent/a2: prevent useless thread launching (#34484)

 hobo/agent/authentic2/provisionning.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
hobo/agent/authentic2/provisionning.py
230 230
            helper(ou, sent_roles)
231 231

  
232 232
    def provision(self):
233
        # Returns if:
234
        # - we are not in a tenant
235
        # - provsionning is disabled
236
        # - there is nothing to do
233 237
        if (not hasattr(connection, 'tenant') or not connection.tenant or not
234 238
                hasattr(connection.tenant, 'domain_url')):
235 239
            return
236 240
        if not getattr(settings, 'HOBO_ROLE_EXPORT', True):
237 241
            return
238
        # exit early if not started
239
        if not hasattr(self.local, 'saved') or not hasattr(self.local, 'deleted'):
242
        if (not getattr(self.local, 'saved', None)
243
                and not getattr(self.local, 'deleted', None)):
240 244
            return
241 245

  
242 246
        t = threading.Thread(target=self.do_provision, kwargs={
243
-