Skip to content

Commit 4b9f2db

Browse files
authored
Merge pull request #547 from rocket357/bonding_iface_check_fix
Update bonding_iface_check.py
2 parents dea1b5f + 5f26d55 commit 4b9f2db

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

playbooks/files/rax-maas/plugins/bonding_iface_check.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ def bonding_ifaces_check(_):
3636
)
3737

3838
has_slave_down = False
39+
slave_count = 0
3940
for idx, line in enumerate(bonding_iface_check_cmd_output_lines):
4041
if line.startswith("Slave Interface"):
42+
slave_count = slave_count + 1
4143
slave_inface_mii_status_line = (
4244
bonding_iface_check_cmd_output_lines[idx + 1]
4345
)
4446
slave_inface_mii_status = (
4547
slave_inface_mii_status_line.split(":")[1]
4648
)
47-
if 'down' in slave_inface_mii_status:
49+
if 'up' not in slave_inface_mii_status or slave_count < 2:
4850
has_slave_down = True
4951

5052
if has_slave_down:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
upgrade:
3+
- |
4+
Add slave_count to ensure the bond has redundancy and check explicitly for not "up"
5+
This ensures a bond slave that is marked down (should only occur in a maintenance
6+
window) triggers an alert.
7+

0 commit comments

Comments
 (0)