Skip to content

Commit

Permalink
[stable-2.9] Fix: nmcli bridge-slave fails with error (#74125)
Browse files Browse the repository at this point in the history
This commit fixes the error for adding bridge
slaves: nmcli bridge-slave returns "Error: invalid or not allowed setting 'bridge-port'

This fix is related to #42460, #54617, and #68065

* changelog
  • Loading branch information
ccamacho committed Apr 5, 2021
1 parent 7b048c4 commit 042d8ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
@@ -0,0 +1,2 @@
minor_changes:
- nmcli - fix the slaving of bridge interfaces (https://github.com/ansible/ansible/pull/74125).
6 changes: 4 additions & 2 deletions lib/ansible/modules/net_tools/nmcli.py
Expand Up @@ -1103,8 +1103,9 @@ def create_connection_bridge_slave(self):
elif self.conn_name is not None:
cmd.append(self.conn_name)

if self.master is not None:
cmd.extend(['master', self.master])
options = {
'master': self.master,
'bridge-port.path-cost': self.path_cost,
'bridge-port.hairpin': self.bool_to_string(self.hairpin),
'bridge-port.priority': self.slavepriority,
Expand All @@ -1119,8 +1120,9 @@ def create_connection_bridge_slave(self):
def modify_connection_bridge_slave(self):
# format for modifying bond-slave interface
cmd = [self.nmcli_bin, 'con', 'mod', self.conn_name]
if self.master is not None:
cmd.extend(['master', self.master])
options = {
'master': self.master,
'bridge-port.path-cost': self.path_cost,
'bridge-port.hairpin': self.bool_to_string(self.hairpin),
'bridge-port.priority': self.slavepriority,
Expand Down

0 comments on commit 042d8ef

Please sign in to comment.