diff --git a/src/pybind/mgr/restful/module.py b/src/pybind/mgr/restful/module.py index a3fcb71c87a..5b55da92da5 100644 --- a/src/pybind/mgr/restful/module.py +++ b/src/pybind/mgr/restful/module.py @@ -80,7 +80,7 @@ class CommandsRequest(object): # Gather the results (in parallel) results = [] for index in range(len(commands)): - tag = '%s:%d' % (str(self.id), index) + tag = '%s:%s:%d' % (__name__, self.id, index) # Store the result result = CommandResult(tag) @@ -361,22 +361,20 @@ class Module(MgrModule): def _notify(self, notify_type, tag): - if notify_type == "command": - # we can safely skip all the sequential commands - if tag == 'seq': - return - - request = [x for x in self.requests if x.is_running(tag)] - if len(request) != 1: - self.log.warn("Unknown request '%s'" % str(tag)) - return - - request = request[0] + if notify_type != "command": + self.log.debug("Unhandled notification type '%s'", notify_type) + return + # we can safely skip all the sequential commands + if tag == 'seq': + return + try: + request = next(x for x in self.requests if x.is_running(tag)) request.finish(tag) if request.is_ready(): request.next() - else: - self.log.debug("Unhandled notification type '%s'" % notify_type) + except StopIteration: + # the command was not issued by me + pass def create_self_signed_cert(self):