Skip to content
Snippets Groups Projects
Commit 40a335ab authored by Robert Latta's avatar Robert Latta
Browse files

added coriant interface name population

parent 9335d3fb
No related branches found
No related tags found
No related merge requests found
......@@ -211,6 +211,16 @@ def _juniper_field_update(record):
return record
def _coriant_field_update(record):
record["interface_name"] = record["card_id"]
if record["port"] is not None and record["port"] != "":
separator = "/" if "-" in record["interface_name"] else ""
record["interface_name"] += separator + str(record["port"])
if record["logical_unit"] is not None and record["logical_unit"] != "":
record["interface_name"] += "." + str(record["logical_unit"])
return record
def _update_fields(r):
func = globals().get("_" + r["manufacturer"] + "_field_update")
return func(r) if func else r
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment