Skip to content

Commit

Permalink
service bus client unquote bug
Browse files Browse the repository at this point in the history
do not unquote endpoint arguments when making subscription name unique,
otherwise the value will be incorrect when it comes to async-messaged.
  • Loading branch information
mgor committed Nov 10, 2023
1 parent 7a1f1ec commit e1797a5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions grizzly/tasks/clients/servicebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,18 @@ def get_state(self, parent: 'GrizzlyScenario') -> State:
if state is None:
context = self.context.copy()
# add id of user as suffix to subscription name, to make it unique
endpoint_arguments = parse_arguments(context['endpoint'], separator=':')
endpoint_arguments = parse_arguments(context['endpoint'], separator=':', unquote=False)

if 'subscription' in endpoint_arguments:
endpoint_arguments['subscription'] = f'{endpoint_arguments["subscription"]}_{id(parent.user)}'
subscription = endpoint_arguments['subscription']
quote = ''
if subscription[0] in ['"', "'"] and subscription[-1] == subscription[0]:
quote = subscription[0]
subscription = subscription[1:-1]
endpoint_arguments['subscription'] = f'{quote}{subscription}_{id(parent.user)}{quote}'
context['endpoint'] = ', '.join([f'{key}:{value}' for key, value in endpoint_arguments.items()])


state = State(
parent=parent,
client=cast(zmq.Socket, self._zmq_context.socket(zmq.REQ)),
Expand Down

0 comments on commit e1797a5

Please sign in to comment.