Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/377.fixed.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed Lumen parser incorrectly marking scheduled future maintenance events as IN-PROCESS instead of CONFIRMED. Bug introduced in commit 737aa4e9 (Aug 2021).
7 changes: 3 additions & 4 deletions circuit_maintenance_parser/parsers/lumen.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ def parse_spans(self, spans: ResultSet, data: Dict):
for sibling in line.next_siblings:
text_sibling = sibling.text.strip() if isinstance(sibling, bs4.element.Tag) else sibling.strip()
if text_sibling != "":
if (
"This maintenance is scheduled" in text_sibling
or "The scheduled maintenance work has begun" in text_sibling
):
if "The scheduled maintenance work has begun" in text_sibling:
data["status"] = Status("IN-PROCESS")
elif "This maintenance is scheduled" in text_sibling:
data["status"] = Status("CONFIRMED")
if "GMT" in text_sibling:
stamp = parser.parse(text_sibling.split(" GMT")[0])
data["stamp"] = self.dt2ts(stamp)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/lumen/lumen3_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"maintenance_id": "987654321-1",
"stamp": 1621494021,
"start": 1621494000,
"status": "IN-PROCESS",
"status": "CONFIRMED",
"summary": "Lumen intends to carry out internal maintenance within its network. This has been designated as EMERGENCY. The nature of this work is to replace faulty hardware and is required in order to improve network reliability and continue providing optimal service for our clients."
}
]
2 changes: 1 addition & 1 deletion tests/unit/data/lumen/lumen4_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"maintenance_id": "123456789",
"stamp": 1628869538,
"start": 1629950400,
"status": "IN-PROCESS",
"status": "CONFIRMED",
"summary": "Lumen will implement scheduled maintenance as part of a large scale project to upgrade code on the IP platform. This maintenance activity is one of several maintenances taking place across various locations in multiple regions. The upgrade will mitigate an existing defect in the current software version and prevent future network outages."
}
]
4 changes: 2 additions & 2 deletions tests/unit/data/lumen/lumen8_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"maintenance_id": "12345678",
"stamp": 1678379003,
"start": 1679457600,
"status": "IN-PROCESS",
"status": "CONFIRMED",
"summary": "Lumen intends to carry out internal maintenance within its network. This has been designated as ESSENTIAL. The nature of this work is to repair fiber and is required in order to avoid unplanned outages from damages related to natural causes."
},
{
Expand All @@ -34,7 +34,7 @@
"maintenance_id": "12345678",
"stamp": 1678379003,
"start": 1679544000,
"status": "IN-PROCESS",
"status": "CONFIRMED",
"summary": "Lumen intends to carry out internal maintenance within its network. This has been designated as ESSENTIAL. The nature of this work is to repair fiber and is required in order to avoid unplanned outages from damages related to natural causes."
}
]