From 647b6d137cfcd05cd4aaee6934458ca7e60fee46 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 19 May 2021 14:26:46 -0700 Subject: [PATCH] [API replay] Log static routes and SG rule IDs Provide more information in log about resources being created Change-Id: I85e9160d62d13f79708db8073d355f9f4e231b10 --- vmware_nsx/api_replay/client.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vmware_nsx/api_replay/client.py b/vmware_nsx/api_replay/client.py index 873c0222cc..fa732264eb 100644 --- a/vmware_nsx/api_replay/client.py +++ b/vmware_nsx/api_replay/client.py @@ -393,6 +393,8 @@ class ApiReplayClient(utils.PrepareObjectForMigration): body = self.prepare_security_group_rule(sg_rule) self.dest_neutron.create_security_group_rule( {'security_group_rule': body}) + LOG.info("Created security group rule for SG " + "%s: %s", sg.get('id'), sg_rule.get('id')) except n_exc.Conflict: # NOTE(arosen): when you create a default # security group it is automatically populated @@ -450,8 +452,9 @@ class ApiReplayClient(utils.PrepareObjectForMigration): try: rules = self.dest_neutron.create_security_group_rule( {'security_group_rules': rules_dict[sg_id]}) - LOG.debug("created %s security group rules for SG %s", - len(rules), 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])) except Exception as e: self.add_error("Failed to create security group %s " "rules: %s" % (sg_id, e)) @@ -536,9 +539,10 @@ class ApiReplayClient(utils.PrepareObjectForMigration): try: self.dest_neutron.update_router(router_id, {'router': {'routes': routes}}) - LOG.info("Added routes to router %(rtr)s %(count)s/%(total)s:", + LOG.info("Added routes to router %(rtr)s " + "%(count)s/%(total)s: %(routes)s", {'count': count, 'total': total_num, - 'rtr': router_id}) + 'rtr': router_id, 'routes': routes}) except Exception as e: self.add_error("Failed to add routes %(routes)s to router " "%(rtr)s: %(e)s" %