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

Commita485106

Browse files
committed
Clean up public task namespace
Tasks imported into other Fabric task files are exposed publicly - see:http://docs.fabfile.org/en/latest/usage/tasks.html#namespacesThis commit cleans up those imports so we don't pollute the publicnamespace.Fixesalphagov#120
1 parentcd34adb commita485106

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎cdn.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fromfabric.apiimport*
22

3-
fromcacheimportpurgeascache_purge
3+
importcache
44

55
@task
66
@runs_once
@@ -16,5 +16,5 @@ def fastly_purge(*args):
1616
@task
1717
defpurge_all(*args):
1818
"Purge items from Fastly and cache machines, eg\"/one,/two,/three\""
19-
execute(cache_purge,*args)
19+
execute(cache.purge,*args)
2020
execute(fastly_purge,*args)

‎vm.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
fromfabric.utilsimporterror
33
importre
44

5+
importnagios
6+
57
@task
68
defuptime():
79
"""Show uptime and load"""
@@ -89,8 +91,7 @@ def reboot():
8991
@task
9092
defforce_reboot():
9193
"""Schedule a host for downtime in nagios and force reboot (even if not required)"""
92-
fromnagiosimportschedule_downtime
93-
execute(schedule_downtime,env['host_string'])
94+
execute(nagios.schedule_downtime,env['host_string'])
9495
run("sudo shutdown -r now")
9596

9697
@task
@@ -100,8 +101,7 @@ def poweroff():
100101
Usage:
101102
fab production -H frontend-1.frontend.production vm.poweroff
102103
"""
103-
fromnagiosimportschedule_downtime
104-
execute(schedule_downtime,env['host_string'])
104+
execute(nagios.schedule_downtime,env['host_string'])
105105
run("sudo poweroff")
106106

107107
@task

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp