コード例 #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)