]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/restful: do not print warning message at seeing unknown request 24514/head
authorKefu Chai <kchai@redhat.com>
Wed, 10 Oct 2018 08:22:59 +0000 (16:22 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 10 Oct 2018 09:18:51 +0000 (17:18 +0800)
commitf67df98d4389d81a721efed9908ffaa340dbec87
treee9671cfed685d2e75a70abef6cb895585b4d7283
parent2e146bf0ca588819ef3bf87acc4ff6dfbc9d5f3e
mgr/restful: do not print warning message at seeing unknown request

mgr broadcast "notify()" to call registered plugins upon finishing a
send_command() request. and restful plugin prints a warning message if
the request is not issued by itself. apparently, there is good chance
that the finished request is sent by other mgr plugins, in that case,
restful plugin always prints the warning messages like:

 "2018-10-09 14:52:07.818 7fbc4d8c5700  1 mgr[restful] Unknown request
''

this is misleading and annoying. so, in this change

* add a prefix of "restful.module" before that tag used for identifying
  a request. this prefix helps to differentiate the requests sent by
  restful plugin from other requests.
* do not print warning message if none running request matches the given tag
* break at seeing the first request matches the given tag, because
  the tags used by restful plugin are unique.
* do not str(self.id) before composing the tag, as it is a `str`
  already, see CommandsRequest.__init__()
* early return to reduce the indent level

Fixes: http://tracker.ceph.com/issues/36374
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/restful/module.py