From ded8348f31dfb2838f79c6c14036a42bc508bc93 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 26 Sep 2022 11:01:04 +0200 Subject: [PATCH 65/75] Add IfCfg model This represents the legacy network configuration stored in /etc/sysconfig/network-scripts in form of ifcfg-* files (along with associated keys-, rules-, routes-, etc. files). --- repos/system_upgrade/el8toel9/models/ifcfg.py | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 repos/system_upgrade/el8toel9/models/ifcfg.py diff --git a/repos/system_upgrade/el8toel9/models/ifcfg.py b/repos/system_upgrade/el8toel9/models/ifcfg.py new file mode 100644 index 00000000..b0607fed --- /dev/null +++ b/repos/system_upgrade/el8toel9/models/ifcfg.py @@ -0,0 +1,42 @@ +from leapp.models import fields, Model +from leapp.topics import SystemInfoTopic + + +class IfCfgProperty(Model): + """ + Key-value pair for ifcfg properties. + + This model is not expected to be used as a message (produced/consumed by actors). + It is used from within the IfCfg model. + """ + topic = SystemInfoTopic + + name = fields.String() + """ Name of a property """ + value = fields.Nullable(fields.String()) + """ Value of a property """ + + +class IfCfg(Model): + """ + IfCfg file describing legacy network configuration + + Produced for every ifcfg file loaded from key-value ("sysconfig") + format described in nm-settings-ifcfg-rh(5) manual. + """ + topic = SystemInfoTopic + + filename = fields.String() + """ Path to file this model was populated from """ + properties = fields.List(fields.Model(IfCfgProperty), default=[]) + """ The list of name-value pairs from ifcfg file """ + secrets = fields.Nullable(fields.List(fields.Model(IfCfgProperty))) + """ The list of name-value pairs from keys file """ + rules = fields.Nullable(fields.List(fields.String())) + """ The list of traffic rules for IPv4 """ + rules6 = fields.Nullable(fields.List(fields.String())) + """ The list of traffic rules for IPv6 """ + routes = fields.Nullable(fields.List(fields.String())) + """ The list of routes for IPv4 """ + routes6 = fields.Nullable(fields.List(fields.String())) + """ The list of routes for IPv6 """ -- 2.39.0