diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-02-02 16:21:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-02-02 16:21:56 +0000 |
commit | 343c6dd14613dcbd009e7339ad609a000915b413 (patch) | |
tree | f7555a87ac3bf8b6f280c9e87c2300ace00bad3d /openstack | |
parent | ea46d462fcfd7d393b71b14206a5e6d86bf1994b (diff) | |
parent | 4f917794a7ff995021a1292dbeb3920a398e0bfe (diff) | |
download | oslo-343c6dd14613dcbd009e7339ad609a000915b413.tar.gz oslo-343c6dd14613dcbd009e7339ad609a000915b413.tar.xz oslo-343c6dd14613dcbd009e7339ad609a000915b413.zip |
Merge "Dict args safe processing."
Diffstat (limited to 'openstack')
-rw-r--r-- | openstack/common/rpc/impl_zmq.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py index 86d2bc5..b3c43a2 100644 --- a/openstack/common/rpc/impl_zmq.py +++ b/openstack/common/rpc/impl_zmq.py @@ -321,21 +321,22 @@ class ConsumerBase(object): return [result] def process(self, style, target, proxy, ctx, data): + data.setdefault('version', None) + data.setdefault('args', {}) + # Method starting with - are # processed internally. (non-valid method name) - method = data['method'] + method = data.get('method') + if not method: + LOG.error(_("RPC message did not include method.")) + return # Internal method # uses internal context for safety. - if data['method'][0] == '-': - # For reply / process_reply - method = method[1:] - if method == 'reply': - self.private_ctx.reply(ctx, proxy, **data['args']) + if method == '-reply': + self.private_ctx.reply(ctx, proxy, **data['args']) return - data.setdefault('version', None) - data.setdefault('args', {}) proxy.dispatch(ctx, data['version'], data['method'], **data['args']) |