Kong/kong-python-pdk

Priority of plugin is always 0 (zero).

krahb opened this issue · 0 comments

krahb commented

I developed a Python plugin using the dedicated server from the PDK and set the priority like this:

# stuff deleted
priority = 1100
# stuff deleted
    start_dedicated_server(
        "myplugin",
        Plugin,
        version,
        priority,
        Schema)

Unfortunately when I start kong and issue the --dump option to my plugin it replies with a priority of 0:

[{"Name": "myplugin", "Phases": ["access"], "Priority": 0, "Schema": "..."}]

After some digging I found that in the module.py the priority is set to 0 and never updated. This is caused by line 59 where the attr is changed to uppercase which is then never found (because it is lowercase). I found that if I remove the .upper() the priority is correctly set, but I don't think that is a pythonic way of doing it.