mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
Clean up / Workaround non-inclusive words
- CHANGELOG.md - README.md - contributing.md - library/network_connections.py - module_utils/network_lsr/argument_validator.py - module_utils/network_lsr/ethtool.py - tests/ensure_provider_tests.py - tests/playbooks/tests_bond_options.yml - tests/unit/test_network_connections.py Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
This commit is contained in:
parent
c526da39c7
commit
f3078c256e
9 changed files with 39 additions and 13 deletions
|
|
@ -170,15 +170,15 @@ Changelog
|
|||
### Changes
|
||||
|
||||
- Use inclusive language
|
||||
- `slave` is deprecated in favor of `port`
|
||||
- `master` is deprecated in favor of `controller`
|
||||
- `slave` is deprecated in favor of `port` <!--- wokeignore:rule=slave -->
|
||||
- `master` is deprecated in favor of `controller` <!--- wokeignore:rule=master -->
|
||||
|
||||
### New features
|
||||
|
||||
- Support disabling IPv6
|
||||
- Support `dns_options` when using one or more IPv4 nameservers
|
||||
- Support Ethtool coalesce settings
|
||||
- Support dummy interfaces
|
||||
- Support dummy interfaces <!--- wokeignore:rule=dummy -->
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
|
|
|||
|
|
@ -843,6 +843,7 @@ following options:
|
|||
|
||||
- `all_ports_active`
|
||||
|
||||
<!--- wokeignore:rule=slave -->
|
||||
`all_slaves_active` in kernel and NetworkManager. The boolean value `false` drops
|
||||
the duplicate frames (received on inactive ports) and the boolean value `true`
|
||||
delivers the duplicate frames.
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ comment. The available commands are:
|
|||
- [citest] - Trigger a re-test for all machines.
|
||||
- [citest bad] - Trigger a re-test for all machines with an error or failure status.
|
||||
- [citest pending] - Trigger a re-test for all machines with a pending status.
|
||||
- [citest commit:<sha1\>] - Whitelist a commit to be tested if the submitter is not
|
||||
- [citest commit:<sha1\>] - Specify a commit to be tested if the submitter is not
|
||||
trusted.
|
||||
|
||||
How to reach us
|
||||
|
|
|
|||
|
|
@ -140,9 +140,11 @@ class SysUtil:
|
|||
links = {}
|
||||
for ifname in os.listdir("/sys/class/net/"):
|
||||
if not os.path.islink("/sys/class/net/" + ifname):
|
||||
# /sys/class/net may contain certain entries that are not
|
||||
# interface names, like 'bonding_master'. Skip over files
|
||||
# that are not links.
|
||||
# /sys/class/net may contain certain entries
|
||||
# that are not interface names, like
|
||||
# wokeignore:rule=master
|
||||
# 'bonding_master'.
|
||||
# Skip over files that are not links.
|
||||
continue
|
||||
links[ifname] = {
|
||||
"ifindex": SysUtil._link_read_ifindex(ifname),
|
||||
|
|
@ -359,6 +361,7 @@ class IfcfgUtil:
|
|||
ifcfg["TYPE"] = "Bridge"
|
||||
elif connection["type"] == "bond":
|
||||
ifcfg["TYPE"] = "Bond"
|
||||
# wokeignore:rule=master
|
||||
ifcfg["BONDING_MASTER"] = "yes"
|
||||
opts = ["mode=%s" % (connection["bond"]["mode"])]
|
||||
if connection["bond"]["miimon"] is not None:
|
||||
|
|
@ -452,9 +455,12 @@ class IfcfgUtil:
|
|||
if connection["port_type"] == "bridge":
|
||||
ifcfg["BRIDGE"] = m
|
||||
elif connection["port_type"] == "bond":
|
||||
# wokeignore:rule=master
|
||||
ifcfg["MASTER"] = m
|
||||
# wokeignore:rule=slave
|
||||
ifcfg["SLAVE"] = "yes"
|
||||
elif connection["port_type"] == "team":
|
||||
# wokeignore:rule=master
|
||||
ifcfg["TEAM_MASTER"] = m
|
||||
if "TYPE" in ifcfg:
|
||||
del ifcfg["TYPE"]
|
||||
|
|
@ -894,13 +900,17 @@ class NMUtil:
|
|||
if option in ["all_ports_active", "use_carrier", "tlb_dynamic_lb"]:
|
||||
value = int(value)
|
||||
if option in ["all_ports_active", "packets_per_port"]:
|
||||
# wokeignore:rule=slave
|
||||
option = option.replace("port", "slave")
|
||||
s_bond.add_option(option, str(value))
|
||||
elif connection["type"] == "team":
|
||||
s_con.set_property(NM.SETTING_CONNECTION_TYPE, NM.SETTING_TEAM_SETTING_NAME)
|
||||
# wokeignore:rule=dummy
|
||||
elif connection["type"] == "dummy":
|
||||
s_con.set_property(
|
||||
NM.SETTING_CONNECTION_TYPE, NM.SETTING_DUMMY_SETTING_NAME
|
||||
# wokeignore:rule=dummy
|
||||
NM.SETTING_CONNECTION_TYPE,
|
||||
NM.SETTING_DUMMY_SETTING_NAME,
|
||||
)
|
||||
elif connection["type"] == "vlan":
|
||||
s_con.set_property(NM.SETTING_CONNECTION_TYPE, NM.SETTING_VLAN_SETTING_NAME)
|
||||
|
|
@ -1045,9 +1055,12 @@ class NMUtil:
|
|||
|
||||
if connection["controller"] is not None:
|
||||
s_con.set_property(
|
||||
NM.SETTING_CONNECTION_SLAVE_TYPE, connection["port_type"]
|
||||
# wokeignore:rule=slave
|
||||
NM.SETTING_CONNECTION_SLAVE_TYPE,
|
||||
connection["port_type"],
|
||||
)
|
||||
s_con.set_property(
|
||||
# wokeignore:rule=master
|
||||
NM.SETTING_CONNECTION_MASTER,
|
||||
ArgUtil.connection_find_controller_uuid(
|
||||
connection["controller"], connections, idx
|
||||
|
|
|
|||
|
|
@ -1794,6 +1794,7 @@ class ArgValidator_DictConnection(ArgValidatorDict):
|
|||
"vlan",
|
||||
"macvlan",
|
||||
"wireless",
|
||||
# wokeignore:rule=dummy
|
||||
"dummy",
|
||||
]
|
||||
VALID_PORT_TYPES = ["bridge", "bond", "team"]
|
||||
|
|
@ -1828,10 +1829,12 @@ class ArgValidator_DictConnection(ArgValidatorDict):
|
|||
enum_values=ArgValidator_DictConnection.VALID_PORT_TYPES,
|
||||
),
|
||||
ArgValidatorDeprecated(
|
||||
# wokeignore:rule=slave
|
||||
"slave_type",
|
||||
deprecated_by="port_type",
|
||||
),
|
||||
ArgValidatorStr("controller"),
|
||||
# wokeignore:rule=master
|
||||
ArgValidatorDeprecated("master", deprecated_by="controller"),
|
||||
ArgValidatorStr("interface_name", allow_empty=True),
|
||||
ArgValidatorMac("mac"),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ def get_perm_addr(ifname):
|
|||
ETHTOOL_GPERMADDR ioctl command.
|
||||
|
||||
Please for further documentation, see:
|
||||
wokeignore:rule=master
|
||||
https://github.com/torvalds/linux/blob/master/include/uapi/linux/ethtool.h#L734
|
||||
wokeignore:rule=master
|
||||
https://github.com/torvalds/linux/blob/master/include/uapi/linux/ethtool.h#L1388
|
||||
https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/tree/ethtool.c#n4172
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ ibution_major_version | int < 9",
|
|||
},
|
||||
"playbooks/tests_bond_options.yml": {},
|
||||
"playbooks/tests_eth_dns_support.yml": {},
|
||||
"playbooks/tests_dummy.yml": {},
|
||||
"playbooks/tests_dummy.yml": {}, # wokeignore:rule=dummy
|
||||
"playbooks/tests_infiniband.yml": {},
|
||||
"playbooks/tests_ipv6_disabled.yml": {},
|
||||
"playbooks/tests_ipv6_dns_search.yml": {},
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@
|
|||
- { key: 'ad_actor_system', value: '00:00:5e:00:53:5d'}
|
||||
- { key: 'ad_select', value: 'stable'}
|
||||
- { key: 'ad_user_port_key', value: '1023'}
|
||||
# wokeignore:rule=slave
|
||||
- { key: 'all_slaves_active', value: '1'}
|
||||
- { key: 'downdelay', value: '0'}
|
||||
- { key: 'lacp_rate', value: 'slow'}
|
||||
|
|
|
|||
|
|
@ -4226,8 +4226,10 @@ class TestValidator(Python26CompatTestCase):
|
|||
route_metric6_configured_ipv6_disabled,
|
||||
)
|
||||
|
||||
# wokeignore:rule=master
|
||||
def test_set_deprecated_master(self):
|
||||
"""
|
||||
wokeignore:rule=master
|
||||
When passing the deprecated "master" it is updated to "controller".
|
||||
"""
|
||||
input_connections = [
|
||||
|
|
@ -4241,17 +4243,20 @@ class TestValidator(Python26CompatTestCase):
|
|||
"state": "up",
|
||||
"type": "ethernet",
|
||||
"interface_name": "eth1",
|
||||
"master": "prod2",
|
||||
"master": "prod2", # wokeignore:rule=master
|
||||
},
|
||||
]
|
||||
connections = ARGS_CONNECTIONS.validate(input_connections)
|
||||
self.assertTrue(len(connections) == 2)
|
||||
for connection in connections:
|
||||
self.assertTrue("controller" in connection)
|
||||
# wokeignore:rule=master
|
||||
self.assertTrue("master" not in connection)
|
||||
|
||||
# wokeignore:rule=slave
|
||||
def test_set_deprecated_slave_type(self):
|
||||
"""
|
||||
wokeignore:rule=slave
|
||||
When passing the deprecated "slave_type" it is updated to "port_type".
|
||||
"""
|
||||
input_connections = [
|
||||
|
|
@ -4266,13 +4271,14 @@ class TestValidator(Python26CompatTestCase):
|
|||
"type": "ethernet",
|
||||
"interface_name": "eth1",
|
||||
"controller": "prod2",
|
||||
"slave_type": "bridge",
|
||||
"slave_type": "bridge", # wokeignore:rule=slave
|
||||
},
|
||||
]
|
||||
connections = ARGS_CONNECTIONS.validate(input_connections)
|
||||
self.assertTrue(len(connections) == 2)
|
||||
for connection in connections:
|
||||
self.assertTrue("port_type" in connection)
|
||||
# wokeignore:rule=slave
|
||||
self.assertTrue("slave_type" not in connection)
|
||||
|
||||
|
||||
|
|
@ -4376,7 +4382,7 @@ class TestValidatorMatch(Python26CompatTestCase):
|
|||
result = self.validator.validate(self.test_profile)
|
||||
self.assertEqual(result["match"], {"path": ["pci-0000:00:03.0"]})
|
||||
|
||||
self.test_profile["type"] = "dummy"
|
||||
self.test_profile["type"] = "dummy" # wokeignore:rule=dummy
|
||||
self.assertRaisesRegex(
|
||||
ValidationError,
|
||||
"'match.path' settings are only supported for type 'ethernet' or 'infiniband'",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue