summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/condition.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/shared/condition.c b/src/shared/condition.c
index 376606e004..17b80d9e0c 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -155,19 +155,15 @@ static int condition_test_virtualization(Condition *c) {
/* First, compare with yes/no */
b = parse_boolean(c->parameter);
-
- if (v > 0 && b > 0)
- return true;
-
- if (v == 0 && b == 0)
- return true;
+ if (b >= 0)
+ return b == !!v;
/* Then, compare categorization */
- if (VIRTUALIZATION_IS_VM(v) && streq(c->parameter, "vm"))
- return true;
+ if (streq(c->parameter, "vm"))
+ return VIRTUALIZATION_IS_VM(v);
- if (VIRTUALIZATION_IS_CONTAINER(v) && streq(c->parameter, "container"))
- return true;
+ if (streq(c->parameter, "container"))
+ return VIRTUALIZATION_IS_CONTAINER(v);
/* Finally compare id */
return v != VIRTUALIZATION_NONE && streq(c->parameter, virtualization_to_string(v));