summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-01-29 13:11:19 +0000
committerMatthew Sackman <matthew@lshift.net>2010-01-29 13:11:19 +0000
commitcb5d035c3731285e26687d7455e64ad00c2a0cfd (patch)
tree9067a864cd83820030da945b87726cfb814b22f0
parentd40e548c5d33dcdf5f15273721a753c77ca8c4cd (diff)
downloadrabbitmq-server-git-cb5d035c3731285e26687d7455e64ad00c2a0cfd.tar.gz
Need to be able to verify that the response got back from the server is ok, when declaring resources.
-rw-r--r--codegen.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/codegen.py b/codegen.py
index 4455973162..ece768a9dd 100644
--- a/codegen.py
+++ b/codegen.py
@@ -166,6 +166,14 @@ def genErl(spec):
def genMethodFieldNames(m):
print "method_fieldnames(%s) -> %s;" % (m.erlangName(), fieldNameList(m.arguments))
+ def genMethodCallResponse(m, methods):
+ if not m.erlangName().endswith("_ok'"):
+ responseName = "'" + erlangize(m.klass.name) + '.' + erlangize(m.name) + "_ok'"
+ filtered = filter(lambda n: n.erlangName() == responseName, methods)
+ if len(filtered) == 1:
+ print "method_call_and_response(#%s{}, #%s{}) -> true;" % (m.erlangName(),
+ responseName)
+
def packMethodFields(fields):
packed = []
bitfield = None
@@ -299,6 +307,7 @@ def genErl(spec):
-export([is_method_synchronous/1]).
-export([method_record/1]).
-export([method_fieldnames/1]).
+-export([method_call_and_response/2]).
-export([decode_method_fields/2]).
-export([decode_properties/2]).
-export([encode_method_fields/1]).
@@ -328,6 +337,9 @@ bitvalue(undefined) -> 0.
for m in methods: genMethodFieldNames(m)
print "method_fieldnames(Name) -> exit({unknown_method_name, Name})."
+ for m in methods: genMethodCallResponse(m, methods)
+ print "method_call_and_response(_Call, _Response) -> false."
+
for m in methods: genDecodeMethodFields(m)
print "decode_method_fields(Name, BinaryFields) ->"
print " rabbit_misc:frame_error(Name, BinaryFields)."