Show More
@@ -81,6 +81,12 b' class HooksDummyClient(object):' | |||
|
81 | 81 | return getattr(hooks, hook_name)(extras) |
|
82 | 82 | |
|
83 | 83 | |
|
84 | class HooksShadowRepoClient(object): | |
|
85 | ||
|
86 | def __call__(self, hook_name, extras): | |
|
87 | return {'output': '', 'status': 0} | |
|
88 | ||
|
89 | ||
|
84 | 90 | class RemoteMessageWriter(object): |
|
85 | 91 | """Writer base class.""" |
|
86 | 92 | def write(self, message): |
@@ -141,9 +147,12 b' def _handle_exception(result):' | |||
|
141 | 147 | |
|
142 | 148 | |
|
143 | 149 | def _get_hooks_client(extras): |
|
144 | if 'hooks_uri' in extras: | |
|
145 | protocol = extras.get('hooks_protocol') | |
|
150 | hooks_uri = extras.get('hooks_uri') | |
|
151 | is_shadow_repo = extras.get('is_shadow_repo') | |
|
152 | if hooks_uri: | |
|
146 | 153 | return HooksHttpClient(extras['hooks_uri']) |
|
154 | elif is_shadow_repo: | |
|
155 | return HooksShadowRepoClient() | |
|
147 | 156 | else: |
|
148 | 157 | return HooksDummyClient(extras['hooks_module']) |
|
149 | 158 |
General Comments 0
You need to be logged in to leave comments.
Login now