From 6dca79686388514ef05dee645604f4f6e6790c6b Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Mon, 16 May 2022 06:41:34 -0400 Subject: [PATCH] infiniband: Fix the bug of wrongly checking whether the device exists When the `p_key` is specified, the virtual infiniband device should be created automatically. And activating the connection on the virtual infiniband device should not require the users to create virtual infiniband device manually upfront. The previous implementation is wrong which validating the presence of virtual infiniband device upfront, as a result, the users have to create the virtual infiniband device manually in the target system in order to activate the connection on the virtual infiniband device through the role. This is an actual bug, the exception raised when the users do not pre-configured such a virtual infiniband device. To address the problem, only checking the existence of the device when the `p_key` is not specified. Signed-off-by: Wen Liang --- library/network_connections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/network_connections.py b/library/network_connections.py index cef8e57..5102173 100644 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -2012,7 +2012,7 @@ class Cmd(object): "interface exists" % (connection["interface_name"]), ) elif connection["type"] == "infiniband": - if connection["infiniband"]["p_key"] != -1: + if connection["infiniband"]["p_key"] == -1: self.log_fatal( idx, "profile specifies interface_name '%s' but no such "