All pastes #38333 Raw Edit

Untitled

public text v1 · immutable
#38333 ·published 2006-01-24 11:35 UTC
rendered paste body
import sys,os,mx.DateTime,logging

ip_backup_machine = 105 #to exclude this ip from the backup process
ip_range = '10.10.10.'
ip_addresses = range(101, 115)

class Backup:
    def start(self):
        for ip in ip_addresses:
            if ip == ip_backup_machine:
                pass
            else:
                self.check_ip(ip_range+str(ip))
                
    def check_ip(self, ip_to_check):
        print "Checking %s" % ip_to_check
        logger.log("Hello there")
class MyLog:
    def log(self,log):
        print "Foo"

if __name__ == '__main__':
    backup_process = Backup()
    backup_process.start()
    logger = MyLog()