invoke fabic with python
2014-08-08 17:31
155 查看
#!/usr/bin/env python
from fabric.api import env,roles,run,execute,sudo,output,put,cd,reboot
from fabric.contrib.console import confirm
import logging
env.roledefs = {
'server1': ['1.1.1.1'],
'server2': ['2.2.2.2'],
}
@roles('server1')
def deploy_server1():
pass
@roles('server2')
def deploy_server2():
pass
def deploy():
deploy_server1()
deploy_server2()
if __name__ == "__main__":
deploy()
from fabric.api import env,roles,run,execute,sudo,output,put,cd,reboot
from fabric.contrib.console import confirm
import logging
env.roledefs = {
'server1': ['1.1.1.1'],
'server2': ['2.2.2.2'],
}
@roles('server1')
def deploy_server1():
pass
@roles('server2')
def deploy_server2():
pass
def deploy():
deploy_server1()
deploy_server2()
if __name__ == "__main__":
deploy()
相关文章推荐
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- Delphi2005学习笔记2——Using Platform Invoke with Delphi 2005
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- Python学习笔记三(Try-cacth&with方法)
- 【LeetCode with Python】 Permutations
- 【LeetCode with Python】 Generate Parentheses
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- [ZT]Understanding Python's "with" statement
- Auto backup something with python in freebsd system
- P/Invoke with SWIG
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- Fun with IronPython and Cecil (Part I)翻译
- Premier.Press.Game.Programming.with.Python.Lua.and.Ruby
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- 从Python & Zope到Java with EJB 3 & JBoss SEAM
- 【LeetCode with Python】 LRU Cache
- 【LeetCode with Python】 Remove Element