deployment/utility/sftp_copy.py [33:90]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.origin_machine_list = machine_list
        self.filter_rule = filter
        self.machine_list = {}

        self.logger = logging.getLogger(__name__)


    def construct_machine_list(self):
        rule_list = []
        self.logger.info("=============================================")
        self.logger.info("================ Filter Rule ================")
        self.logger.info("=============================================")
        if self.filter_rule != None:
            for rule in self.filter_rule:
                kv = rule.split("=")
                rule_list.append({"key":kv[0], "value":kv[1]})
                self.logger.info("key = {0}, value = {1}".format(kv[0], kv[1]))
        else:
            self.logger.info("No filter rule.")
        self.logger.info("\n")
        self.logger.info("\n")

        self.logger.info("=============================================")
        self.logger.info("======= Machine List After filtered =========")
        self.logger.info("=============================================")
        for hostname in self.origin_machine_list:
            host = self.origin_machine_list[hostname]
            for rule in rule_list:
                if rule["key"] not in host:
                    break
                if host[rule["key"]] != rule["value"]:
                    break
            else:
                self.machine_list[hostname] = host
                self.logger.info("Machine Host Name: {0},   Machine Ip Address: {1}".format(hostname, host["hostip"]))
        self.logger.info("\n")
        self.logger.info("\n")

        count_input = 0
        while True:
            user_input = raw_input("Do you want to continue this operation? (Y/N) ")
            if user_input == "N":
                sys.exit(1)
            elif user_input == "Y":
                break
            else:
                print(" Please type Y or N.")
            count_input = count_input + 1
            if count_input == 3:
                self.logger.warning("3 Times.........  Sorry,  we will force stopping your operation.")
                sys.exit(1)

    def run(self):

        self.construct_machine_list()

        for hostname in self.machine_list:
            host = self.machine_list[hostname]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



deployment/utility/ssh.py [30:88]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.origin_machine_list = machine_list
        self.filter_rule = filter
        self.machine_list = {}

        self.logger = logging.getLogger(__name__)


    def construct_machine_list(self):
        rule_list = []
        self.logger.info("=============================================")
        self.logger.info("================ Filter Rule ================")
        self.logger.info("=============================================")
        if self.filter_rule != None:
            for rule in self.filter_rule:
                kv = rule.split("=")
                rule_list.append({"key":kv[0], "value":kv[1]})
                self.logger.info("key = {0}, value = {1}".format(kv[0], kv[1]))
        else:
            self.logger.info("No filter rule.")
        self.logger.info("\n")
        self.logger.info("\n")

        self.logger.info("=============================================")
        self.logger.info("======= Machine List After filtered =========")
        self.logger.info("=============================================")
        for hostname in self.origin_machine_list:
            host = self.origin_machine_list[hostname]
            for rule in rule_list:
                if rule["key"] not in host:
                    break
                if host[rule["key"]] != rule["value"]:
                    break
            else:
                self.machine_list[hostname] = host
                self.logger.info("Machine Host Name: {0},   Machine Ip Address: {1}".format(hostname, host["hostip"]))
        self.logger.info("\n")
        self.logger.info("\n")

        count_input = 0
        while True:
            user_input = raw_input("Do you want to continue this operation? (Y/N) ")
            if user_input == "N":
                sys.exit(1)
            elif user_input == "Y":
                break
            else:
                print(" Please type Y or N.")
            count_input = count_input + 1
            if count_input == 3:
                self.logger.warning("3 Times.........  Sorry,  we will force stopping your operation.")
                sys.exit(1)


    def run(self):

        self.construct_machine_list()

        for hostname in self.machine_list:
            host = self.machine_list[hostname]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



