def __init__(self,ipadd,fm_path,session=None):
        self.class_name = 'Update'
        self.ls = LogShow(self.class_name)
        if isinstance(ipadd, str):
            self.ip = ipadd
        else:
            self.ip = str(ipadd)
        if not Check.checkIP(self.ip):
            self.ls.log_print('warn', self.ip + ' is not valuable!', '__init__')
        if isinstance(fm_path, str):            
            self.firmware_path = fm_path
        else:
            self.firmware_path = str(fm_path)

        self.url_update = 'http://' + self.ip + '/service/system/firmware_upgrade/full_update'
        self.url_status = 'http://' + self.ip + '/service/system/task/status'
        self.url_update_new = 'http://' + self.ip + '/service/system/system_upgrade'
        self.url_restore = 'http://' + self.ip + '/service/system/restore'
        self.url_stop = 'http://' + self.ip + '/service/system/stop'
        self.url_start = 'http://' + self.ip + '/service/system/start'
        
        self.login = LogIn(self.ip)
        if session is None:
            self.Login()
        else:
            self.session = session
Esempio n. 2
0
    def __init__(self, ipadd, session=None):
        self.class_name = 'GetVersion'
        self.ls = LogShow(self.class_name)

        if isinstance(ipadd, str):
            self.ip = ipadd
        else:
            self.ip = str(ipadd)
        if not Check.checkIP(self.ip):
            self.ls.log_print('warn', self.ip + ' is not valuable', '__init__')
        self.webcontroller = WebController(self.ip, session)
    def __init__(self, ipadd, username="******", password="******"):

        self.class_name = "Sftp"
        self.ls = LogShow(self.class_name)

        if isinstance(ipadd, str):
            self.ip = ipadd
        else:
            self.ip = str(ipadd)
        if not Check.checkIP(self.ip):
            self.ls.log_print('warn', self.ip + 'is not the valuable ip!',
                              '__init__')

        if isinstance(username, str):
            self.username = username
        else:
            self.username = str(username)
        if isinstance(password, str):
            self.password = password
        else:
            self.username = str(password)

        self.Connect()
Esempio n. 4
0
    def __init__(self, ip, port=21, bufsize=1024, username=None, password=None):
        self.class_name = "Ftp"
        self.ls = LogShow(self.class_name)
        if not Check.checkIP(ip):
            self.ls.log_print('warn', ip + ' is not valuable !')
        
        self.ip = ip
        
        if username is not None:
            self.username = username
        else:
            self.username = '******'
        
        if password is not None:
            self.password = password
        else:
            self.password = None

        self.port = (int)port
        self.bufsize = (int)bufsize

        if not hasattr(self,'ftp'):
            self.ftp = FTP()
        self.Connect()