利用Pool类多进程实现批量主机管理
1 #!/usr/bin/python 2 # -*- coding: UTF-8 -*- 3 # Author: standby 4 # Time: 2017-03-02 5 # Description: Achieve the Multiple Processes(High Concurrent) to execute single or multiple commands functions by pool class of Python Lang. 6 7 import time 8 import commands, subprocess 9 import os, re, sys 10 import paramiko 11 from multiprocessing import Pool 12 13 # print color 14 COLOR_PINK = '