1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

add reasons to ixf import log for add and modify actions (gh-408) (#483)

This commit is contained in:
Matt Griswold
2019-04-30 10:33:35 -05:00
committed by GitHub
parent 1bd56c3312
commit b4a025c912
4 changed files with 66 additions and 14 deletions

View File

@@ -378,12 +378,15 @@ class Importer(object):
self.netixlans.append(result["netixlan"])
if result["created"]:
action = "add"
reason = _("New ip-address")
else:
action = "modify"
reason = _("Fields changed: {}").format(
", ".join(result.get("changed")))
self.log_peer(asn, action, "", result["netixlan"])
self.log_peer(asn, action, reason, result["netixlan"])
elif result["netixlan"]:
self.log_peer(asn, "noop", "", result["netixlan"])
self.log_peer(asn, "noop", _("No changes"), result["netixlan"])
elif result["log"]:
self.log_peer(asn, "ignore", "\n".join(result["log"]),
netixlan_info)