Files
sudo/plugins/python/regress/plugin_conflict.py
Robert Manner 99f8394182 plugins/python/regress: add a failing textcase about python plugins affect each other
Since python plugins are run inside the same interpreter, they affect
each other's state, which would be better to avoid.
2020-01-24 12:25:15 -07:00

12 lines
326 B
Python

import sudo
import sys
sys.path = []
class ConflictPlugin(sudo.Plugin):
def __init__(self, plugin_options, **kwargs):
sudo.log_info("PATH before: {} (should be empty)".format(sys.path))
sys.path = [sudo.options_as_dict(plugin_options).get("Path")]
sudo.log_info("PATH set: {}".format(sys.path))