From 48017a27400a341330610d841abefface86aa5ef Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 29 Jan 2020 13:23:57 +0100 Subject: [PATCH] conf: Complete ordering functions for ConfigOption class --- conf/format-options.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/format-options.py b/conf/format-options.py index 578ccf2f7d..40e7fd461b 100755 --- a/conf/format-options.py +++ b/conf/format-options.py @@ -68,8 +68,9 @@ import sys import re from textwrap import TextWrapper from argparse import ArgumentParser -from functools import cmp_to_key +from functools import cmp_to_key, total_ordering +@total_ordering class ConfigOption: """Representing a configuration option or described section in strongswan.conf""" def __init__(self, path, default = None, section = False, commented = False, include = False): @@ -83,6 +84,9 @@ class ConfigOption: self.desc = [] self.options = [] + def __eq__(self, other): + return self.name == other.name + def __lt__(self, other): return self.name < other.name -- 2.47.3