Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit338b449

Browse files
committed
Selectively disablewww.gov.uk vhost and not assets vhost
1 parente83c0c7 commit338b449

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

‎incident.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
fromfabric.apiimport*
2-
fromnginximportkillasnginx_kill
3-
frompuppetimportdisableaspuppet_disable
2+
importnginx
3+
importpuppet
44

55
@task
66
@roles('class-cache')
77
deffail_to_mirror():
88
"""Fails the site to the mirror"""
9-
puppet_disable()
10-
nginx_kill()
11-
print("Disabled Puppet and stopped Nginx, remember to re-enable these")
9+
puppet.disable()
10+
nginx.disable_vhost("www.gov.uk")
11+
nginx.hello_it()
12+
print("Disabled Puppet and disabled www.gov.uk vhost, remember to re-enable these")

‎nginx.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ def gracefulstop(wait=True):
99
# Poll for Nginx, until it's no longer running.
1010
run('while pgrep nginx >/dev/null; do echo "Waiting for Nginx to exit.."; sleep 1; done')
1111

12+
@task
13+
defdisable_vhost(vhost_filename):
14+
"""Disable a vhost by removing its symlink from /etc/nginx/sites-enabled"""
15+
sudo('rm -f /etc/nginx/sites-enabled/%s'%vhost_filename)
16+
1217
@task
1318
defkill():
1419
"""Shut down Nginx immediately without waiting for it to finish running"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp