Skip to content

Commit 615261f

Browse files
committed
get the bonding master from slave interface
The patch identifies and returns the bonding master for a slave interface. Signed-off-by: Vaishnavi Bhat <[email protected]>
1 parent 2d58369 commit 615261f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

avocado/utils/network/interfaces.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ def _get_bondinterface_details(self):
135135
f"Slave interface not found for " f"the bond {self.name}"
136136
) from exc
137137

138+
def _get_bondingmaster(self):
139+
cmd = (
140+
f"/sys/class/net/{self.name}/master "
141+
)
142+
try:
143+
bond_master = run_command(cmd, self.host).splitlines()
144+
return bond_master
145+
except Exception as exc:
146+
raise NWException(
147+
f"Bonding master not found for " f"the interface {self.name}"
148+
) from exc
149+
138150
def _move_file_to_backup(self, filename, ignore_missing=True):
139151
destination = f"{filename}.backup"
140152
if os.path.exists(filename):

0 commit comments

Comments
 (0)