- raise RuntimeError(
- 'Could not attach interface, reason:{}'.format(stderr))
- cmd = 'ip netns exec {} ip link set {} up'.format(
- namespace, interface)
- (ret_code, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True)
+ raise RuntimeError(f"Could not attach interface, reason:\n{stderr}")
+
+ cmd = f"ip netns exec {namespace} ip link set {interface} up"
+
+ ret_code, _, stderr = exec_cmd(node, cmd, timeout=5, sudo=True)