qrexec.policy.parser_compat – Parser for legacy policy¶
This module is transitional and may go away any time.
- qrexec.policy.parser_compat.walk_compat_files(legacy_path=PosixPath('/etc/qubes-rpc/policy'))[source]¶
Walks files in correct order for generating compat policy.
- Parameters:
legacy_path (pathlib.Path) – base path for legacy policy
- Yields:
(service, argument, filepath)
- class qrexec.policy.parser_compat.Compat40Loader(*, legacy_path=None, **kwds)[source]¶
This parser should be used as helper for executing compatibility statement:
>>> class MyParser(qrexec.policy.parser.AbstractPolicyParser): ... def handle_compat40(self, *, filepath, lineno): ... subparser = Compat40Parser(master=self) ... subparser.execute(filepath=filepath, lineno=lineno)
- class qrexec.policy.parser_compat.Compat40Parser(*, master, **kwds)[source]¶
Abstract parser for compat policy. Needs
walk_includes().- Parameters:
master (qrexec.policy.parser.AbstractPolicyParser) – the parser that will handle all the syntax parsed from the legacy policy
- class qrexec.policy.parser_compat.TestCompat40Loader(*, legacy_path=None, **kwds)[source]¶
Used for tests. See
qrexec.policy.parser.StringPolicy.