Skip to content

Commit 491ea99

Browse files
Merge pull request #90 from networktocode/gfm-extra-lumen-statuses
Handle more potential Lumen statuses seen in the field
2 parents ce4173c + 08d0234 commit 491ea99

File tree

1 file changed

+10
-2
lines changed
  • circuit_maintenance_parser/parsers

1 file changed

+10
-2
lines changed

circuit_maintenance_parser/parsers/lumen.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import bs4 # type: ignore
77
from bs4.element import ResultSet # type: ignore
88

9-
from circuit_maintenance_parser.parser import Html, Impact, CircuitImpact, Status
9+
from circuit_maintenance_parser.parser import CircuitImpact, Html, Impact, Status
1010

1111
# pylint: disable=too-many-nested-blocks, too-many-branches
1212

@@ -88,8 +88,16 @@ def parse_tables(self, tables: ResultSet, data: Dict):
8888
if "account" not in data:
8989
data["account"] = cells[idx].string
9090
if num_columns == 10:
91-
if cells[idx + 9].string == "Completed":
91+
status_string = cells[idx + 9].string
92+
if status_string == "Completed":
9293
data["status"] = Status("COMPLETED")
94+
elif status_string == "Postponed":
95+
data["status"] = Status("RE-SCHEDULED")
96+
elif status_string == "Not Completed":
97+
data["status"] = Status("CANCELLED")
98+
elif "status" not in data:
99+
# Update to an existing ticket may not include an update to the status - make a guess
100+
data["status"] = "CONFIRMED"
93101

94102
data_circuit = {}
95103
data_circuit["circuit_id"] = cells[idx + 1].string

0 commit comments

Comments
 (0)