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
This commit is contained in:
Salvatore Orlando 2021-06-03 06:31:35 -07:00 committed by Salvatore Orlando
parent 8e3bcb0861
commit d9dc33fecc
1 changed files with 2 additions and 1 deletions

View File

@ -455,7 +455,8 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
{'security_group_rules': rules_dict[sg_id]}) {'security_group_rules': rules_dict[sg_id]})
LOG.info("Created %d security group rules for SG %s: %s", LOG.info("Created %d security group rules for SG %s: %s",
len(rules), sg_id, 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: except Exception as e:
self.add_error("Failed to create security group %s " self.add_error("Failed to create security group %s "
"rules: %s" % (sg_id, e)) "rules: %s" % (sg_id, e))