caches: fix import of compute_key_from_params function.

This commit is contained in:
Marcin Kuzminski 2018-08-23 19:17:07 +02:00
parent e7c5cbb270
commit 4bec4980b0
3 changed files with 5 additions and 6 deletions

View file

@ -34,7 +34,7 @@ from rhodecode.lib.base import bootstrap_request, bootstrap_config
from rhodecode.lib import hooks_base
from rhodecode.lib.utils2 import AttributeDict
from rhodecode.lib.ext_json import json
from rhodecode.lib import rc_cache
log = logging.getLogger(__name__)
@ -45,10 +45,9 @@ class HooksHttpHandler(BaseHTTPRequestHandler):
method, extras = self._read_request()
txn_id = getattr(self.server, 'txn_id', None)
if txn_id:
from rhodecode.lib.caches import compute_key_from_params
log.debug('Computing TXN_ID based on `%s`:`%s`',
extras['repository'], extras['txn_id'])
computed_txn_id = compute_key_from_params(
computed_txn_id = rc_cache.utils.compute_key_from_params(
extras['repository'], extras['txn_id'])
if txn_id != computed_txn_id:
raise Exception(

View file

@ -86,7 +86,7 @@ class SimpleSvnApp(object):
if response.headers.get('SVN-Txn-name'):
svn_tx_id = response.headers.get('SVN-Txn-name')
txn_id = rc_cache.compute_key_from_params(
txn_id = rc_cache.utils.compute_key_from_params(
self.config['repository'], svn_tx_id)
port = safe_int(self.rc_extras['hooks_uri'].split(':')[-1])
store_txn_id_data(txn_id, {'port': port})

View file

@ -64,7 +64,7 @@ log = logging.getLogger(__name__)
def extract_svn_txn_id(acl_repo_name, data):
"""
Helper method for extraction of svn txn_id from submited XML data during
Helper method for extraction of svn txn_id from submitted XML data during
POST operations
"""
try:
@ -77,7 +77,7 @@ def extract_svn_txn_id(acl_repo_name, data):
match = pat.search(sub_el.text)
if match:
svn_tx_id = match.groupdict()['txn_id']
txn_id = rc_cache.compute_key_from_params(
txn_id = rc_cache.utils.compute_key_from_params(
acl_repo_name, svn_tx_id)
return txn_id
except Exception: