+ cmd = f"adf_ctl status | grep {device['pci_address']} | "
+ cmd += "awk '{print $1}'"
+ stdout, _ = exec_cmd_no_error(
+ node, cmd, sudo=True, message="Failed to check crypto device!"
+ )
+ if stdout.strip():
+ qat_dev = stdout.split("_")[-1]
+ conf_file = f"/etc/{device['driver']}_{qat_dev.strip()}.conf"
+ exec_cmd_no_error(
+ node, f"adf_ctl --config {conf_file} {stdout.strip()} restart",
+ sudo=True, message="Failed to restart crypto device!"
+ )
+ else:
+ raise ValueError("Crypto device error")
+