From: Perry Gagne <pgagne(a)redhat.com>
The arg to exec_cmd was evaluating to empty string.
Probably due to the order of operations of if ... else ...
Reworked it so it does what we expect
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
lnst/Devices/TeamDevice.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lnst/Devices/TeamDevice.py b/lnst/Devices/TeamDevice.py
index 6be7841..f4e7101 100644
--- a/lnst/Devices/TeamDevice.py
+++ b/lnst/Devices/TeamDevice.py
@@ -47,8 +47,10 @@ class TeamDevice(MasterDevice):
def _create(self):
teamd_json = json.dumps(self.config)
- exec_cmd(f"teamd -r -d -c '{teamd_json}' -t {self.name}"
- " -D" if self.dbus else "")
+ cmd = f"teamd -r -d -c '{teamd_json}' -t {self.name}"
+ if self.dbus:
+ cmd += " -D"
+ exec_cmd(cmd)
retry = 0
while self._nl_msg is None and retry < 5:
--
2.21.1