示例#1
0
文件: deploy.py 项目: kkfnui/ToolKit
class Deploy:
    __nodes = []
    __switcher = None
    __deploy_nodes = []

    def __init__(self, conf, app_name):
        v = json.load(file(conf), object_hook=lambda d: namedtuple('server', d.keys())(*d.values()))
        for item in v:
            if item.name == "recsys-servering":
                servers = item.servers
                self.__deploy_nodes = item.deploy
                streams = []
                for server in servers:
                    node = DeployNode(server)
                    self.__nodes.append(node)
                    streams.append(server.stream)

                self.__switcher = NginxSwitcher(item.switcher, streams)

    def deploy(self):
        for node in self.__nodes:
            if node.name() in self.__deploy_nodes:
                print("----deploy-----" + node.name())
                self.__switcher.disable(node.ip())
                node.deploy()
                self.__switcher.reset()
示例#2
0
文件: deploy.py 项目: kkfnui/ToolKit
class Deploy:
    __nodes = []
    __switcher = None
    __deploy_nodes = []

    def __init__(self, conf, app_name):
        v = json.load(file(conf),
                      object_hook=lambda d: namedtuple('server', d.keys())
                      (*d.values()))
        for item in v:
            if item.name == "recsys-servering":
                servers = item.servers
                self.__deploy_nodes = item.deploy
                streams = []
                for server in servers:
                    node = DeployNode(server)
                    self.__nodes.append(node)
                    streams.append(server.stream)

                self.__switcher = NginxSwitcher(item.switcher, streams)

    def deploy(self):
        for node in self.__nodes:
            if node.name() in self.__deploy_nodes:
                print("----deploy-----" + node.name())
                self.__switcher.disable(node.ip())
                node.deploy()
                self.__switcher.reset()
示例#3
0
文件: deploy.py 项目: kkfnui/ToolKit
    def __init__(self, conf, app_name):
        v = json.load(file(conf),
                      object_hook=lambda d: namedtuple('server', d.keys())
                      (*d.values()))
        for item in v:
            if item.name == "recsys-servering":
                servers = item.servers
                self.__deploy_nodes = item.deploy
                streams = []
                for server in servers:
                    node = DeployNode(server)
                    self.__nodes.append(node)
                    streams.append(server.stream)

                self.__switcher = NginxSwitcher(item.switcher, streams)
示例#4
0
文件: deploy.py 项目: kkfnui/ToolKit
    def __init__(self, conf, app_name):
        v = json.load(file(conf), object_hook=lambda d: namedtuple('server', d.keys())(*d.values()))
        for item in v:
            if item.name == "recsys-servering":
                servers = item.servers
                self.__deploy_nodes = item.deploy
                streams = []
                for server in servers:
                    node = DeployNode(server)
                    self.__nodes.append(node)
                    streams.append(server.stream)

                self.__switcher = NginxSwitcher(item.switcher, streams)