Skip to content

Commit

Permalink
Fixes #952: skmanage properly clean up blocking connection on exit (#953
Browse files Browse the repository at this point in the history
)

Closes: #952
(cherry picked from commit 6bba638)
  • Loading branch information
kgiusti authored and ganeshmurthy committed Feb 28, 2023
1 parent bcc5ca0 commit 8311c4c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions tools/skmanage
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,18 @@ class QdManage():
self.opts.indent = None
if len(self.args) == 0:
raise UsageError("No operation specified")
self.node = Node.connect(opts_url(self.opts), self.opts.router, self.opts.timeout,
opts_ssl_domain(self.opts),
opts_sasl(self.opts),
edge_router=self.opts.edge_router)

operation = self.args.pop(0)
method = operation.lower().replace('-', '_')
if operation.upper() in self.operations and hasattr(self, method):
getattr(self, method)() # Built-in operation
else:
self.operation(operation) # Custom operation

with Node.connect(opts_url(self.opts), self.opts.router, self.opts.timeout,
opts_ssl_domain(self.opts),
opts_sasl(self.opts),
edge_router=self.opts.edge_router) as self.node:

operation = self.args.pop(0)
method = operation.lower().replace('-', '_')
if operation.upper() in self.operations and hasattr(self, method):
getattr(self, method)() # Built-in operation
else:
self.operation(operation) # Custom operation

def main(self, argv):
return main(self.run, argv, self.op)
Expand Down

0 comments on commit 8311c4c

Please sign in to comment.