nispor/0001-python-use-snake_case-interface-types.patch
DistroBaker de59af5d7f Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/nispor.git#2b50b5f39232e4b8a6df10263ba54cd9ed5960e6
2020-11-09 15:36:53 +00:00

59 lines
2.0 KiB
Diff

From 674d186570f98fecc24248c9879473346a321225 Mon Sep 17 00:00:00 2001
From: Fernando Fernandez Mancera <ffmancera@riseup.net>
Date: Mon, 9 Nov 2020 12:16:31 +0100
Subject: [PATCH] python: use snake_case interface types
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Gris Ge <fge@redhat.com>
---
src/python/nispor/iface.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/python/nispor/iface.py b/src/python/nispor/iface.py
index 4dbcc46..26eb84b 100644
--- a/src/python/nispor/iface.py
+++ b/src/python/nispor/iface.py
@@ -54,28 +54,28 @@ class NisporIfaceState:
def _iface_info_to_obj(iface_info):
iface_type = iface_info["iface_type"]
ctrl_type = iface_info.get("controller_type")
- if iface_type == "Bond":
+ if iface_type == "bond":
iface = NisporBond(iface_info)
- elif iface_type == "Bridge":
+ elif iface_type == "bridge":
iface = NisporBridge(iface_info)
- elif iface_type == "Tun":
+ elif iface_type == "tun":
iface = NisporTun(iface_info)
- elif iface_type == "Vlan":
+ elif iface_type == "vlan":
iface = NisporVlan(iface_info)
- elif iface_type == "Vxlan":
+ elif iface_type == "vxlan":
iface = NisporVxlan(iface_info)
- elif iface_type == "Veth":
+ elif iface_type == "veth":
iface = NisporVeth(iface_info)
- elif iface_type == "Vrf":
+ elif iface_type == "vrf":
iface = NisporVRF(iface_info)
- elif iface_type == "MacVlan":
+ elif iface_type == "mac_vlan":
iface = NisporMacVlan(iface_info)
- elif iface_type == "MacVtap":
+ elif iface_type == "mac_vtap":
iface = NisporMacVtap(iface_info)
else:
iface = NisporBaseIface(iface_info)
- if ctrl_type == "Bond":
+ if ctrl_type == "bond":
iface.subordinate_state = NisporBondSubordinate(iface_info)
- elif ctrl_type == "Bridge":
+ elif ctrl_type == "bridge":
iface.subordinate_state = NisporBridgePort(iface_info)
return iface
--
2.29.2