Skip to content
Snippets Groups Projects
Commit 0eceb2af authored by Ravi Tripathi's avatar Ravi Tripathi
Browse files

Changes in this commit:

* Create a queuename variable based on the percent encoding of username.
* Pass 'queuename' attribute to add_user function.
* Create routing key based on 'queuename' rather then 'username'
parent 101659dc
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,9 @@ args = parser.parse_args()
timeout = 60
if args.email == '':
queuename = rc_util.encode_name(args.username)
if args.email == "":
args.email = args.username
if '@' not in args.email:
args.email = args.username + '@' + args.domain
......@@ -43,12 +45,20 @@ def callback(channel, method, properties, body):
rc_util.rc_rmq.delete_queue()
rc_util.add_account(args.username, email=args.email, full=args.full_name, reason=args.reason)
print(f'Account for {args.username} requested.')
rc_util.add_account(
args.username,
queuename=queuename,
email=args.email,
full=args.full_name,
reason=args.reason,
)
print(f"Account for {args.username} requested.")
# Set initial timeout timer
signal.signal(signal.SIGALRM, timeout_handler)
signal.setitimer(signal.ITIMER_REAL, timeout)
print('Waiting for completion...')
rc_util.consume(args.username, routing_key=f'complete.{args.username}', callback=callback)
print("Waiting for completion...")
rc_util.consume(
queuename, routing_key=f"complete.{queuename}", callback=callback
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment