##// END OF EJS Templates
hooks: added extra logging.
marcink -
r1455:7e5ee316 default
parent child Browse files
Show More
@@ -25,6 +25,7 b' Set of hooks run by RhodeCode Enterprise'
25 25
26 26 import os
27 27 import collections
28 import logging
28 29
29 30 import rhodecode
30 31 from rhodecode import events
@@ -34,6 +35,8 b' from rhodecode.lib.utils2 import safe_st'
34 35 from rhodecode.lib.exceptions import HTTPLockedRC, UserCreationError
35 36 from rhodecode.model.db import Repository, User
36 37
38 log = logging.getLogger(__name__)
39
37 40
38 41 HookResponse = collections.namedtuple('HookResponse', ('status', 'output'))
39 42
@@ -91,7 +94,6 b' def pre_push(extras):'
91 94 It bans pushing when the repository is locked.
92 95 """
93 96 usr = User.get_by_username(extras.username)
94
95 97 output = ''
96 98 if extras.locked_by[0] and usr.user_id != int(extras.locked_by[0]):
97 99 locked_by = User.get(extras.locked_by[0]).username
@@ -251,10 +253,14 b' class ExtensionCallback(object):'
251 253 self._kwargs_keys = set(kwargs_keys)
252 254
253 255 def __call__(self, *args, **kwargs):
256 log.debug('Calling extension callback for %s', self._hook_name)
257
254 258 kwargs_to_pass = dict((key, kwargs[key]) for key in self._kwargs_keys)
255 259 callback = self._get_callback()
256 260 if callback:
257 261 return callback(**kwargs_to_pass)
262 else:
263 log.debug('extensions callback not found skipping...')
258 264
259 265 def is_active(self):
260 266 return hasattr(rhodecode.EXTENSIONS, self._hook_name)
General Comments 0
You need to be logged in to leave comments. Login now