Skip to content

Commit cac60ac

Browse files
committed
Add example of Equinix email without clearly stated status in subject line
1 parent 964e6f0 commit cac60ac

File tree

6 files changed

+510
-2
lines changed

6 files changed

+510
-2
lines changed

circuit_maintenance_parser/parsers/equinix.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,15 @@ def parse_subject(self, subject: str) -> List[Dict]:
112112
if maintenance_id:
113113
data["maintenance_id"] = maintenance_id[1]
114114
data["summary"] = subject.strip().replace("\n", "")
115-
if "COMPLETED" in subject:
115+
if "completed" in subject.lower():
116116
data["status"] = Status.COMPLETED
117-
if "SCHEDULED" in subject or "REMINDER" in subject:
117+
elif "rescheduled" in subject.lower():
118+
data["status"] = Status.RE_SCHEDULED
119+
elif "scheduled" in subject.lower() or "reminder" in subject.lower():
118120
data["status"] = Status.CONFIRMED
121+
else:
122+
# Some Equinix notifications don't clearly state a status in their subject.
123+
# From inspection of examples, it looks like "Confirmed" would be the most appropriate in this case.
124+
data["status"] = Status.CONFIRMED
125+
119126
return [data]

0 commit comments

Comments
 (0)