selinonlib.builtin_predicate module
Built-in predicates used as core building blocks to build predicates.
-
class
selinonlib.builtin_predicate.
AlwaysTruePredicate
(flow)[source]
Bases: selinonlib.builtin_predicate.BuiltinPredicate
Predicate used if condition in config file is omitted.
-
ast
()[source]
Python AST of this predicate (construct transitively for all indirect children as well).
Returns: | AST of describing all children predicates |
-
check
()[source]
Check predicate for consistency.
-
static
create
(tree, nodes_from, flow, can_inspect_results)[source]
-
nodes_used
()[source]
-
predicates_used
()[source]
-
requires_message
()[source]
-
class
selinonlib.builtin_predicate.
AndPredicate
(children)[source]
Bases: selinonlib.builtin_predicate.NaryPredicate
And predicate representation.
-
ast
()[source]
Python AST of this predicate (construct transitively for all indirect children as well).
Returns: | AST of describing all children predicates |
-
static
create
(tree, nodes_from, flow, can_inspect_results)[source]
Create And predicate.
Parameters: |
- tree (List) – node from which should be predicate instantiated
- nodes_from – nodes that are used in described edge
- flow (Flow) – flow to which predicate belongs to
- can_inspect_results (bool) – True if predicates in the condition can query task result
|
Returns: | instance of cls
|
-
class
selinonlib.builtin_predicate.
BuiltinPredicate
[source]
Bases: selinonlib.predicate.Predicate
Build in predicate abstract class.
-
class
selinonlib.builtin_predicate.
NaryPredicate
(children)[source]
Bases: selinonlib.builtin_predicate.BuiltinPredicate
N-ary predicate abstract class.
-
check
()[source]
Check predicate for consistency.
-
nodes_used
()[source]
Compute nodes that are used (transitively).
Returns: | list of nodes that are used |
Return type: | List[Node] |
-
predicates_used
()[source]
Compute predicates that are used (transitively).
Returns: | used predicates by children |
-
requires_message
()[source]
Check whether any of child predicates requires results of nodes.
Returns: | True if any of the children require results of parent task |
-
class
selinonlib.builtin_predicate.
NotPredicate
(child)[source]
Bases: selinonlib.builtin_predicate.UnaryPredicate
Unary or predicate representation.
-
ast
()[source]
Python AST of this predicate (construct transitively for all indirect children as well).
Returns: | AST of describing all children predicates |
-
static
create
(tree, nodes_from, flow, can_inspect_results)[source]
Create Or predicate.
Parameters: |
- tree (List) – node from which should be predicate instantiated
- nodes_from – nodes that are used in described edge
- flow (Flow) – flow to which predicate belongs to
- can_inspect_results (bool) – True if predicates in the condition can query task result
|
Returns: | instance of cls
|
-
class
selinonlib.builtin_predicate.
OrPredicate
(children)[source]
Bases: selinonlib.builtin_predicate.NaryPredicate
And predicate representation.
-
ast
()[source]
Python AST of this predicate (construct transitively for all indirect children as well).
Returns: | AST of describing all children predicates |
-
static
create
(tree, nodes_from, flow, can_inspect_results)[source]
Create Or predicate.
Parameters: |
- tree (List) – node from which should be predicate instantiated
- nodes_from – nodes that are used in described edge
- flow (Flow) – flow to which predicate belongs to
- can_inspect_results (bool) – True if predicates in the condition can query task result
|
Returns: | instance of cls
|
-
class
selinonlib.builtin_predicate.
UnaryPredicate
(child)[source]
Bases: selinonlib.builtin_predicate.BuiltinPredicate
Unary predicate abstract class.
-
check
()[source]
Check predicate for consistency.
-
nodes_used
()[source]
Compute all nodes that are used (transitively) by child/children.
Returns: | list of nodes that are used |
Return type: | List[Node] |
-
predicates_used
()[source]
Compute all predicates that are used (transitively) by child/children.
Returns: | used predicates by children |
-
requires_message
()[source]
Check whether any of child predicate(s) requires results of nodes (transitively).
Returns: | True if the child requires results of parent task |