Changeset View
Changeset View
Standalone View
Standalone View
test/lint/check-rpc-mappings.py
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | for (cmdname, argidx, argname) in mapping: | ||||
try: | try: | ||||
rargnames = cmds_by_name[cmdname].args[argidx].names | rargnames = cmds_by_name[cmdname].args[argidx].names | ||||
except IndexError: | except IndexError: | ||||
print('ERROR: {} argument {} (named {} in vRPCConvertParams) is not defined in dispatch table'.format( | print('ERROR: {} argument {} (named {} in vRPCConvertParams) is not defined in dispatch table'.format( | ||||
cmdname, argidx, argname)) | cmdname, argidx, argname)) | ||||
errors += 1 | errors += 1 | ||||
continue | continue | ||||
if argname not in rargnames: | if argname not in rargnames: | ||||
print('ERROR: {} argument {} is named {} in vRPCConvertParams but {} in dispatch table'.format(cmdname, argidx, argname, rargnames), file=sys.stderr) | print('ERROR: {} argument {} is named {} in vRPCConvertParams but {} in dispatch table'.format( | ||||
cmdname, argidx, argname, rargnames), file=sys.stderr) | |||||
errors += 1 | errors += 1 | ||||
# Check for conflicts in vRPCConvertParams conversion | # Check for conflicts in vRPCConvertParams conversion | ||||
# All aliases for an argument must either be present in the | # All aliases for an argument must either be present in the | ||||
# conversion table, or not. Anything in between means an oversight | # conversion table, or not. Anything in between means an oversight | ||||
# and some aliases won't work. | # and some aliases won't work. | ||||
for cmd in cmds: | for cmd in cmds: | ||||
for arg in cmd.args: | for arg in cmd.args: | ||||
Show All 32 Lines |