python自动化部署脚本客户端

#!/usr/bin/python
#coding=gbk
'''
Created on 2017年3月9日

@author: ligang
'''
import socket
import commands
import time
import os
import shutil
import psutil
import threading

###############################################################################

#部署项目
def docker_deploy(messagearr):

    try:
        print("解析部署参数")
        containers = messagearr[2]
        dockerimages = messagearr[3]
    dockerport = messagearr[4]
        status = docker_deploy_process(containers,dockerimages,dockerport)
        return status

    except Exception , e:

        print("部署出错......")
        print e
        return 101

#部署主函数
def docker_deploy_process(containers,dockerimages,dockerport):

    try:

        commands_line = "/home/shell/dockerrun  "+containers+" "+dockerimages+" "+dockerport
        re

你可能感兴趣的:(系统运维)