3de38762aa
Change-Id: Ie417df96258c2daa852d14e588de4ad2d54bb819
13 lines
495 B
Python
Executable File
13 lines
495 B
Python
Executable File
from orm_common.hooks.transaction_id_hook import TransactionIdHook
|
|
from orm_common.utils import utils
|
|
|
|
|
|
class TransIdHook(TransactionIdHook):
|
|
|
|
def before(self, state):
|
|
transaction_id = utils.make_transid()
|
|
tracking_id = state.request.headers['X-RANGER-Tracking-Id'] \
|
|
if 'X-RANGER-Tracking-Id' in state.request.headers else transaction_id
|
|
setattr(state.request, 'transaction_id', transaction_id)
|
|
setattr(state.request, 'tracking_id', tracking_id)
|