Skip to content

Commit 521cb2f

Browse files
committed
Merge pull request saltstack#18804 from garethgreenaway/12178_debian_briding
fixes to debian_ip.py
2 parents 0c66555 + d102218 commit 521cb2f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

salt/modules/debian_ip.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,8 @@ def _parse_bridge_opts(opts, iface):
10861086
config = {}
10871087

10881088
if 'ports' in opts:
1089+
if isinstance(opts['ports'], list):
1090+
opts['ports'] = ','.join(opts['ports'])
10891091
config.update({'ports': opts['ports']})
10901092

10911093
for opt in ['ageing', 'fd', 'gcint', 'hello', 'maxage']:
@@ -1536,7 +1538,7 @@ def build_interface(iface, iface_type, enabled, **settings):
15361538

15371539
elif iface_type == 'bridge':
15381540
if 'ports' not in settings:
1539-
msg = 'ports is a required setting for bridge interfaces'
1541+
msg = 'ports is a required setting for bridge interfaces on Debian or Ubuntu based systems'
15401542
log.error(msg)
15411543
raise AttributeError(msg)
15421544
__salt__['pkg.install']('bridge-utils')

salt/states/network.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,18 @@
148148
- proto: dhcp
149149
- bridge: br0
150150
- delay: 0
151+
- ports: eth4
151152
- bypassfirewall: True
152153
- use:
153154
- network: eth4
154155
- require:
155156
- network: eth4
157+
158+
.. note::
159+
160+
When managing bridged interfaces on a Debian or Ubuntu based system, the
161+
ports argument is required. Red Hat systems will ignore the argument.
162+
156163
'''
157164

158165
# Import python libs

0 commit comments

Comments
 (0)