summaryrefslogtreecommitdiff
path: root/python/ovs/jsonrpc.py
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-08-24 17:06:11 -0700
committerBen Pfaff <blp@nicira.com>2011-08-25 11:07:23 -0700
commitb2a5856fef8239b1c33c63804cefc5b140836b9a (patch)
tree18d9fec664a6e5fdf3c619f28f44dbac6ead9e78 /python/ovs/jsonrpc.py
parent6732237bee6d3e9721bfa5cdf7ba131f559f767f (diff)
downloadopenvswitch-b2a5856fef8239b1c33c63804cefc5b140836b9a.tar.gz
ovs.jsonrpc: Fix static method Message.__validate_arg reference to 'self'.
This method needs to be an instance method because it refers to 'self'. Found by pychecker.
Diffstat (limited to 'python/ovs/jsonrpc.py')
-rw-r--r--python/ovs/jsonrpc.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/python/ovs/jsonrpc.py b/python/ovs/jsonrpc.py
index da7fa084b..f10a0da1b 100644
--- a/python/ovs/jsonrpc.py
+++ b/python/ovs/jsonrpc.py
@@ -72,8 +72,7 @@ class Message(object):
def type_to_string(type_):
return Message.__types[type_]
- @staticmethod
- def __validate_arg(value, name, must_have):
+ def __validate_arg(self, value, name, must_have):
if (value is not None) == (must_have != 0):
return None
else:
@@ -96,11 +95,11 @@ class Message(object):
return "invalid JSON-RPC message type %s" % self.type
return (
- Message.__validate_arg(self.method, "method", pattern & 0x10000) or
- Message.__validate_arg(self.params, "params", pattern & 0x1000) or
- Message.__validate_arg(self.result, "result", pattern & 0x100) or
- Message.__validate_arg(self.error, "error", pattern & 0x10) or
- Message.__validate_arg(self.id, "id", pattern & 0x1))
+ self.__validate_arg(self.method, "method", pattern & 0x10000) or
+ self.__validate_arg(self.params, "params", pattern & 0x1000) or
+ self.__validate_arg(self.result, "result", pattern & 0x100) or
+ self.__validate_arg(self.error, "error", pattern & 0x10) or
+ self.__validate_arg(self.id, "id", pattern & 0x1))
@staticmethod
def from_json(json):