Skip to content

Commit 8fe88f6

Browse files
authored
Merge pull request #278 from jmaslak/bugfix/crown-castle-increase-description-robustness
Increase robustness of Crown Castle parsing
2 parents 7162407 + 4b0f8d7 commit 8fe88f6

File tree

4 files changed

+280
-5
lines changed

4 files changed

+280
-5
lines changed

circuit_maintenance_parser/parsers/crowncastle.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@ def parse_strong(self, soup, data):
5656
for strong in soup.find_all("strong"):
5757
if strong.string.strip() == "Ticket Number:":
5858
data["maintenance_id"] = strong.next_sibling.strip()
59-
if strong.string.strip() == "Description:":
60-
summary = strong.parent.next_sibling.next_sibling.contents[0].string.strip()
61-
summary = re.sub(r"[\n\r]", "", summary)
62-
data["summary"] = summary
63-
if strong.string.strip().startswith("Work Description:"):
59+
val = strong.string.strip()
60+
if val == "Description:" or val.startswith("Work Description:"):
6461
for sibling in strong.parent.next_siblings:
6562
summary = "".join(sibling.strings)
6663
summary = re.sub(r"[\n\r]", "", summary)
Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<title></title>
6+
<style>
7+
.timezonegrid, #circuitgrid {
8+
font-family: Arial;
9+
border-collapse: collapse;
10+
font-size: 12px;
11+
}
12+
13+
.timezonegrid td, .timezonegrid th, #circuitgrid td, #circuitgrid th {
14+
border: 1px solid #ddd;
15+
padding: 8px;
16+
}
17+
18+
.timezonegrid thead, #circuitgrid thead {
19+
padding-top: 2px;
20+
padding-bottom: 2px;
21+
border: 1px solid #ddd;
22+
text-align: left;
23+
}
24+
25+
body {
26+
font-family: Arial;
27+
border-collapse: collapse;
28+
font-size: 12px;
29+
}
30+
</style>
31+
</head>
32+
<body>
33+
<div>
34+
<table style="width: 90%; border:none; border-spacing:0; padding:0;">
35+
<tbody>
36+
<tr>
37+
<td valign="top">
38+
<p align="center"><b><u><span><img src="https://tempgo.crowncastle.com/rs/343-LQR-650/images/image01_CCLogo2.png" height="65" width="246"></span></u></b></p>
39+
</td>
40+
</tr>
41+
<tr>
42+
<td valign="top">
43+
<p align="center">&nbsp;</p>
44+
</td>
45+
</tr>
46+
<tr>
47+
<td valign="top">
48+
<p align="center"><b><span style="color:#5A6771;font-size:24px"><u>Maintenance Notification</u></span></b></p>
49+
</td>
50+
</tr>
51+
<tr>
52+
<td>
53+
<p></p>
54+
</td>
55+
</tr>
56+
<tr>
57+
<td>
58+
<p></p>
59+
</td>
60+
</tr>
61+
<tr>
62+
<td valign="top">
63+
<p>&nbsp;</p>
64+
<p>&nbsp;</p>
65+
<p></p>
66+
<p></p>
67+
<p>Dear Example Customer, <br>
68+
<br>
69+
This notice is being sent to notify you of the following planned maintenance event on the Crown Castle Fiber network.
70+
<br>
71+
<br>
72+
</p>
73+
<p><strong>Ticket Number: </strong>CM20231201000</p>
74+
<p><strong>Location of Work: </strong>Northern VA</p>
75+
<p></p>
76+
<p>
77+
<table class="timezonegrid">
78+
<tbody>
79+
<tr>
80+
<th colspan="2">Scheduled Start Date &amp; Time </th>
81+
<th colspan="2">Scheduled End Date &amp; Time </th>
82+
<th>Time Zone </th>
83+
</tr>
84+
<tr>
85+
<td>1/25/2024 </td>
86+
<td>1:00 AM </td>
87+
<td>1/29/2024 </td>
88+
<td>7:00 AM </td>
89+
<td>Eastern </td>
90+
</tr>
91+
<tr>
92+
<td>1/25/2024 </td>
93+
<td>12:00 AM </td>
94+
<td>1/29/2024 </td>
95+
<td>6:00 AM </td>
96+
<td>Central </td>
97+
</tr>
98+
<tr>
99+
<td>1/24/2024 </td>
100+
<td>11:00 PM </td>
101+
<td>1/29/2024 </td>
102+
<td>5:00 AM </td>
103+
<td>Mountain </td>
104+
</tr>
105+
<tr>
106+
<td>1/24/2024 </td>
107+
<td>10:00 PM </td>
108+
<td>1/29/2024 </td>
109+
<td>4:00 AM </td>
110+
<td>Pacific </td>
111+
</tr>
112+
<tr>
113+
<td>1/25/2024 </td>
114+
<td>5:00 AM </td>
115+
<td>1/29/2024 </td>
116+
<td>11:00 AM </td>
117+
<td>GMT </td>
118+
</tr>
119+
</tbody>
120+
</table>
121+
</p>
122+
<p><strong>Expected Customer Impact:</strong> Potential Service Affecting</p>
123+
<p><strong>Expected Impact Duration:</strong> None Expected</p>
124+
<p><strong>Days Recurring:</strong> 5</p>
125+
<p><strong>Work</strong> <strong>Description:</strong></p>
126+
<p></p>
127+
<p style="margin-top:5pt;margin-bottom:5pt;font-family:Calibri;font-size:11.5pt;">
128+
Crown Castle Fiber partner carrier will be conducting a required maintenance at the above-listed location for a splice case audit. No impact to your circuit(s) listed below is expected. The work will not occur during business hours.</p>
129+
<p style="margin-top:5pt;margin-bottom:5pt;font-family:Calibri;font-size:11.5pt;">
130+
30.0000, -75.0000 <br>
131+
SE corner of Main &amp; 1st Ave</p>
132+
<div style="direction:ltr;">
133+
<table border="1" cellpadding="0" cellspacing="0" valign="top" style="border:1pt solid #A3A3A3;direction:ltr;
134+
border-collapse:collapse;">
135+
<tbody>
136+
<tr>
137+
<td style="border:1pt solid #A3A3A3;
138+
vertical-align:top;width:.7513in;padding:4pt 4pt 4pt 4pt;">
139+
<p style="margin-top:5pt;margin-bottom:5pt;font-family:Calibri;font-size:
140+
11.5pt;">
141+
3/25/24</p>
142+
</td>
143+
<td style="border:1pt solid #A3A3A3;
144+
vertical-align:top;width:1.8298in;padding:4pt 4pt 4pt 4pt;">
145+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">01:00 am to 07:00 am EST</p>
146+
</td>
147+
</tr>
148+
<tr>
149+
<td style="border:1pt solid #A3A3A3;
150+
vertical-align:top;width:.7513in;padding:4pt 4pt 4pt 4pt;">
151+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">3/26/24</p>
152+
</td>
153+
<td style="border:1pt solid #A3A3A3;
154+
vertical-align:top;width:1.8298in;padding:4pt 4pt 4pt 4pt;">
155+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">01:00 am to 07:00 am EST</p>
156+
</td>
157+
</tr>
158+
<tr>
159+
<td style="border:1pt solid #A3A3A3;
160+
vertical-align:top;width:.7513in;padding:4pt 4pt 4pt 4pt;">
161+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">3/27/24</p>
162+
</td>
163+
<td style="border:1pt solid #A3A3A3;
164+
vertical-align:top;width:1.8298in;padding:4pt 4pt 4pt 4pt;">
165+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">01:00 am to 07:00 am EST</p>
166+
</td>
167+
</tr>
168+
<tr>
169+
<td style="border:1pt solid #A3A3A3;
170+
vertical-align:top;width:.7513in;padding:4pt 4pt 4pt 4pt;">
171+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">3/28/24</p>
172+
</td>
173+
<td style="border:1pt solid #A3A3A3;
174+
vertical-align:top;width:1.8298in;padding:4pt 4pt 4pt 4pt;">
175+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">01:00 am to 07:00 am EST</p>
176+
</td>
177+
</tr>
178+
<tr>
179+
<td style="border:1pt solid #A3A3A3;
180+
vertical-align:top;width:.7513in;padding:4pt 4pt 4pt 4pt;">
181+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">3/29/24</p>
182+
</td>
183+
<td style="border:1pt solid #A3A3A3;
184+
vertical-align:top;width:1.8298in;padding:4pt 4pt 4pt 4pt;">
185+
<p style="margin:0in;font-family:Calibri;font-size:11.5pt;">01:00 am to 07:00 am EST</p>
186+
</td>
187+
</tr>
188+
</tbody>
189+
</table>
190+
</div>
191+
<p></p>
192+
<p><br>
193+
Customer Circuits: </p>
194+
<p>
195+
<table id="circuitgrid">
196+
<thead>
197+
<tr>
198+
<th>Circuit ID</th>
199+
<th>Active Product</th>
200+
<th>A Location</th>
201+
<th>Z Location</th>
202+
<th>Impact</th>
203+
<th>Notes</th>
204+
</tr>
205+
</thead>
206+
<tbody>
207+
<tr>
208+
<td>666666-WAVE-CCF</td>
209+
<td>Wavelength / DC to DC Connectivity - Inter Market / 10GigE</td>
210+
<td>123 Main, Anytown, USA</td>
211+
<td>321 Main, Anytown, USA</td>
212+
<td>None Expected</td>
213+
<td></td>
214+
</tr>
215+
</tbody>
216+
</table>
217+
</p>
218+
<p></p>
219+
<p></p>
220+
<p></p>
221+
<p><strong>Dark-Fiber Customers:</strong> <br>
222+
<br>
223+
Dark Fiber services cannot be monitored by Crown Castle, we are reliant on customer feed back for confirmation that services have restored. To ensure your services have restored, we are requesting that you provide a contact which is both familiar with the service
224+
and would be able to promptly confirm service restoration once the CM is complete. The request for confirmation may be needed after hours, please provide both a name and contact phone number in response to this email.
225+
<br>
226+
<br>
227+
If you have any questions or concerns prior to this event, please reply to this notification as soon as possible.
228+
<br>
229+
<br>
230+
By responding to this notification in a timely manner, Crown Castle Fiber Change Management can attempt to resolve any potential conflicts that may arise.
231+
<br>
232+
<br>
233+
If you have any questions, concerns or issues before, during or after this maintenance window, please contact our Change Management Department at 1-508-621-1888 and reference this ticket number.
234+
<br>
235+
<br>
236+
If you have any service/performance related issues after this maintenance window, please contact our Network Operations Center at 1-855-93-FIBER (1-855-933-4237) and reference this ticket number.
237+
</p>
238+
<p></p>
239+
<br>
240+
Thank You,<br>
241+
<br>
242+
<i>Change Control<br>
243+
Email: <a class="auto-style1" href="mailto:[email protected]"><span style="color:#0066cc;">[email protected]</span></a><br>
244+
508-621-1888</i>
245+
<p></p>
246+
<p><img width="208" height="55" src="https://tempgo.crowncastle.com/rs/343-LQR-650/images/image01_CCLogo2.png"></p>
247+
</td>
248+
</tr>
249+
</tbody>
250+
</table>
251+
</div>
252+
<p></p>
253+
<p align="center"><i><span style="color:black;font-size:9.5px">Please note: every maintenance entails a certain level of risk and although Crown Castle Fiber makes every effort to provide accurate expected customer impact, conditions outside of Crown Castle
254+
Fiber's control may cause impact to be greater than anticipated.</span></i></p>
255+
This email may contain confidential or privileged material. Use or disclosure of it by anyone other than the recipient is unauthorized. If you are not an intended recipient, please delete this email.
256+
</body>
257+
</html>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[
2+
{
3+
"account": "Example Customer",
4+
"circuits": [
5+
{
6+
"circuit_id": "666666-WAVE-CCF",
7+
"impact": "OUTAGE"
8+
}
9+
],
10+
"end": 1706526000,
11+
"maintenance_id": "CM20231201000",
12+
"start": 1706158800,
13+
"status": "CONFIRMED",
14+
"summary": "Crown Castle Fiber partner carrier will be conducting a required maintenance at the above-listed location for a splice case audit. No impact to your circuit(s) listed below is expected. The work will not occur during business hours."
15+
}
16+
]

tests/unit/test_parsers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ def default(self, o):
267267
Path(dir_path, "data", "crowncastle", "crowncastle8.html"),
268268
Path(dir_path, "data", "crowncastle", "crowncastle8_parser_result.json"),
269269
),
270+
(
271+
HtmlParserCrownCastle1,
272+
Path(dir_path, "data", "crowncastle", "crowncastle9.html"),
273+
Path(dir_path, "data", "crowncastle", "crowncastle9_parser_result.json"),
274+
),
270275
# Equinix
271276
(
272277
HtmlParserEquinix,

0 commit comments

Comments
 (0)