From eb92c380422a18289b072e9e38e1cf91dfeb0c9e Mon Sep 17 00:00:00 2001 From: Adrien Banlin Date: Mon, 12 Jun 2023 10:42:41 +0200 Subject: [PATCH] networkinterfaces: make auto alias of allow-auto The commit make the auto_ifaces container pointing to the allow_classes['auto'] list. (since it's a mutable object, we get the same instance) --- ifupdown2/ifupdown/networkinterfaces.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ifupdown2/ifupdown/networkinterfaces.py b/ifupdown2/ifupdown/networkinterfaces.py index 2bebe39..ffa62ab 100644 --- a/ifupdown2/ifupdown/networkinterfaces.py +++ b/ifupdown2/ifupdown/networkinterfaces.py @@ -53,7 +53,6 @@ class networkInterfaces(): Raises: AttributeError, KeyError """ - self.auto_ifaces = [] self.callbacks = {} self.auto_all = False self.raw = raw @@ -62,7 +61,9 @@ class networkInterfaces(): self.callbacks = {'iface_found' : None, 'validateifaceattr' : None, 'validateifaceobj' : None} - self.allow_classes = {} + self.allow_classes = {'auto': []} + # auto is only an aliases of allow-auto + self.auto_ifaces = self.allow_classes['auto'] self.interfacesfile = interfacesfile self.interfacesfileiobuf = interfacesfileiobuf self.interfacesfileformat = interfacesfileformat