Skip to content

Commit 737ffa5

Browse files
committed
Merge pull request alphagov#46 from alphagov/vm_poweroff
[#71750148] Add task to power off a VM
2 parents 53a1cf0 + 768e073 commit 737ffa5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

vm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,14 @@ def reboot():
6565
from nagios import schedule_downtime
6666
execute(schedule_downtime, env['host_string'])
6767
run("sudo shutdown -r now")
68+
69+
@task
70+
def poweroff():
71+
"""Schedule a host for downtime in nagios and shutdown the VM
72+
73+
Usage:
74+
fab production -H frontend-1.frontend.production vm.poweroff
75+
"""
76+
from nagios import schedule_downtime
77+
execute(schedule_downtime, env['host_string'])
78+
run("sudo poweroff")

0 commit comments

Comments
 (0)