首页 > 编程语言 > 详细

python

时间:2016-03-06 18:55:50      阅读:255      评论:0      收藏:0      [点我收藏+]

stdin, stdout, stderr = client.exec_command(‘cd /home/someone;mkdir aa‘)

 

 

def remote_modify(mblade):
    client = master_module.get_connection(‘remote_modify‘, mblade, port, username1, password1)
    client.exec_command(‘cd /opt/app/jboss-eap-6.0/standalone/configuration;mv standalone.xml standalone.xml.bak‘)
    stdin, stdout, stderr = client.exec_command(‘cd /opt/app/jboss-eap-6.0/standalone/configuration;cat standalone.xml.bak‘)
    file = ‘‘
    find = 0
    for line in stdout:
        if ‘‘‘<connector name="http-post" protocol="HTTP/1.1" scheme="http" socket-binding="http-post"‘‘‘ in line and ‘/>‘ in line:
            find += 1
            continue
        if ‘‘‘<socket-binding name="http-post" port=‘‘‘ in line and ‘/>‘ in line:
            find += 1
            continue
        file = file + line + ‘\n‘
    if find!=2:
        print ‘***********SOMETHING ERROR, Please check standalone.xml!!!‘
    file_str = ‘‘
    client.exec_command("cd /opt/app/jboss-eap-6.0/standalone/configuration;echo ‘" + file + "‘ > standalone.xml")
    client.close()

  

python

原文:http://www.cnblogs.com/drizzlewithwind/p/5065798.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!