From 6eb42966cb1f4af0c932c9fa76a1bf4fc2747500 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 10 May 2021 10:05:28 -0700 Subject: [PATCH] [API Replay] Stop processing when security group creation fails In this case, there is no point in processing rules. Processing will also fail due to an unreferenced variable. Change-Id: I1344eca7ef1667be5a66b8d63818ba5e8f43ac20 --- vmware_nsx/api_replay/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vmware_nsx/api_replay/client.py b/vmware_nsx/api_replay/client.py index 873c0222cc..7dc18c18cf 100644 --- a/vmware_nsx/api_replay/client.py +++ b/vmware_nsx/api_replay/client.py @@ -418,6 +418,8 @@ class ApiReplayClient(utils.PrepareObjectForMigration): except Exception as e: self.add_error("Failed to create security group (%(sg)s): " "%(e)s" % {'sg': sg, 'e': e}) + # Don't bother going to rules + continue # Use bulk rules creation for the rules of the SG if not sg_rules: