Netdevice's id is alphanumeric, not just digits, so when calling
get_mapped_device() this id shouldn't be converted to int.
Otherwise a ValueError exception is raised:
CommandException: CommandException: Slave bondmaster: invalid literal
for int() with base 10: 'eth1'
Signed-off-by: Artem Savkov <asavkov(a)redhat.com>
---
lnst/Slave/NetConfigDevice.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 4fa1b50..054d15a 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -103,7 +103,7 @@ class NetConfigDeviceBond(NetConfigDeviceGeneric):
"primary" option is not direct value but it's
index of netdevice. So take the appropriate name from config
'''
- slave_dev = self._if_manager.get_mapped_device(int(value))
+ slave_dev = self._if_manager.get_mapped_device(value)
value = slave_dev.get_name()
exec_cmd('echo "%s" > %s/%s' % (value,
self._get_bond_dir(),
--
1.9.3