fix(autogen): Do not set nic_code from nic_name 75/40275/3
authorVratko Polak <vrpolak@cisco.com>
Mon, 29 Jan 2024 14:11:20 +0000 (15:11 +0100)
committerVratko Polak <vrpolak@cisco.com>
Wed, 31 Jan 2024 07:52:03 +0000 (07:52 +0000)
This should fix some suites wrongly using nic_pfs=6.

Change-Id: Ifb7bd24b9a2d1764634eea4a43b4509f16e03da2
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
resources/libraries/python/autogen/Regenerator.py

index 7a6bc9f..706c250 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -380,7 +380,6 @@ def write_default_files(in_filename, in_prolog, kwargs_list):
                     Constants.NIC_CODE_TO_PFS[nic_code], 1,
                     "NIC PFs argument should appear once.", in_filename
                 )
-
                 iface, suite_id, suite_tag = get_iface_and_suite_ids(
                     out_filename
                 )
@@ -441,7 +440,6 @@ def write_reconf_files(in_filename, in_prolog, kwargs_list):
             tmp_filename
         )
         for driver in Constants.NIC_NAME_TO_DRIVER[nic_name]:
-            nic_code = Constants.NIC_NAME_TO_CODE[nic_name]
             out_filename = replace_defensively(
                 tmp_filename, old_suite_id,
                 Constants.NIC_DRIVER_TO_SUITE_PREFIX[driver] + old_suite_id,
@@ -471,7 +469,6 @@ def write_reconf_files(in_filename, in_prolog, kwargs_list):
                 Constants.NIC_CODE_TO_PFS[nic_code], 1,
                 "NIC PFs argument should appear once.", in_filename
             )
-
             iface, suite_id, suite_tag = get_iface_and_suite_ids(out_filename)
             out_prolog = replace_defensively(
                 out_prolog, old_suite_tag, suite_tag, 1,
@@ -515,7 +512,6 @@ def write_tcp_files(in_filename, in_prolog, kwargs_list):
             tmp_filename
         )
         for driver in Constants.NIC_NAME_TO_DRIVER[nic_name]:
-            nic_code = Constants.NIC_NAME_TO_CODE[nic_name]
             out_filename = replace_defensively(
                 tmp_filename, old_suite_id,
                 Constants.NIC_DRIVER_TO_SUITE_PREFIX[driver] + old_suite_id,
@@ -545,7 +541,6 @@ def write_tcp_files(in_filename, in_prolog, kwargs_list):
                 Constants.NIC_CODE_TO_PFS[nic_code], 1,
                 "NIC PFs argument should appear once.", in_filename
             )
-
             iface, suite_id, suite_tag = get_iface_and_suite_ids(out_filename)
             out_prolog = replace_defensively(
                 out_prolog, old_suite_tag, suite_tag, 1,
@@ -677,7 +672,6 @@ def write_device_files(in_filename, in_prolog, kwargs_list):
                 tmp2_filename
             )
             for driver in Constants.NIC_NAME_TO_DRIVER[nic_name]:
-                nic_code = Constants.NIC_NAME_TO_CODE[nic_name]
                 out_filename = replace_defensively(
                     tmp2_filename, old_suite_id,
                     Constants.NIC_DRIVER_TO_SUITE_PREFIX[driver] + old_suite_id,
@@ -707,7 +701,6 @@ def write_device_files(in_filename, in_prolog, kwargs_list):
                     Constants.NIC_CODE_TO_PFS[nic_code], 1,
                     "NIC PFs argument should appear once.", in_filename
                 )
-
                 iface, suite_id, suite_tag = get_iface_and_suite_ids(
                     out_filename
                 )