Skip to content

Commit 93906b9

Browse files
committed
Check for OK status when purging Fastly
In a similar vein to 26ec51c, we should also make output from Fastly less verbose by checking for an "ok" response status.
1 parent 26ec51c commit 93906b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cdn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def fastly_purge(*args):
1111
hostnames_to_purge = ['www.gov.uk', 'assets.digital.cabinet-office.gov.uk']
1212
for govuk_path in args:
1313
for hostname in hostnames_to_purge:
14-
run("curl -s -X PURGE -H 'Host: {0}' {1}{2}".format(hostname, govuk_fastly, govuk_path.strip()))
14+
run("curl -s -X PURGE -H 'Host: {0}' {1}{2} | grep 'ok'".format(hostname, govuk_fastly, govuk_path.strip()))
1515

1616
@task
1717
def purge_all(*args):

0 commit comments

Comments
 (0)