• python


    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 + '
    '
        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()
    

      

  • 相关阅读:
    费马小定理
    CF 1365D Solve The Maze
    CF 1367D Task On The Board
    CF 1368B Codeforces Subsequences
    CF 1368C Even Picture
    mybatis框架
    Ajax
    jdbc
    jQuery
    JSP
  • 原文地址:https://www.cnblogs.com/drizzlewithwind/p/5065798.html
Copyright © 2020-2023  润新知