From d9dc33fecc54b5cb0a5460c70cf62aeb2f97d049 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Thu, 3 Jun 2021 06:31:35 -0700 Subject: [PATCH] API replay: parse properly SG rules in LOG statement An error in parsing the data structure is the cause of an exception raised during logging; because of this API replay fails. Change-Id: I4846f674f56dd414719c595a592c3135ba536d02 --- vmware_nsx/api_replay/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/api_replay/client.py b/vmware_nsx/api_replay/client.py index 3b580dbf1c..cda583ca24 100644 --- a/vmware_nsx/api_replay/client.py +++ b/vmware_nsx/api_replay/client.py @@ -455,7 +455,8 @@ class ApiReplayClient(utils.PrepareObjectForMigration): {'security_group_rules': rules_dict[sg_id]}) LOG.info("Created %d security group rules for SG %s: %s", len(rules), sg_id, - ",".join([rule.get('id') for rule in rules])) + ",".join([rule.get('id') for rule in + rules.get('security_group_rules', [])])) except Exception as e: self.add_error("Failed to create security group %s " "rules: %s" % (sg_id, e))