Ejemplo n.º 1
0
    def wait_worklist_exec_finish(obj_database):    
        """
        """          
        ret = ERR_FAIL
        err_message = ""
        
        event1 = threading.Event() 
        save_worklist_event(obj_database.id_, event1)
        
        timeout = webservercfg.ACS_WAIT_AGENT_WORKLIST_EXEC_RSP_TIMEOUT + \
                    webservercfg.ACS_WAIT_WORKLIST_EXEC_FINISH_TIMEOUT
                    
        log.app_info("worklist(id=%s) begin wait finish." %obj_database.id_)
        event1.wait(timeout)
        log.app_info("worklist(id=%s) end wait finish." %obj_database.id_)
                
        if (event1.isSet()):  

            # update obj_database
            obj_database = restore_acs_part_worklist(obj_database.id_)
            
            if (obj_database.status == WORK_LIST_STATUS_SUCCESS):
                ret = ERR_SUCCESS
            else:
                err_message = "worklist(id=%s) status is not success(%s)" %(obj_database.id_, obj_database.status)
        else:
            err_message = "worklist(id=%s) timeout(%s seconds)" %(obj_database.id_, timeout)

        del event1
        pop_worklist_event(obj_database.id_)
        
        return ret, err_message        
Ejemplo n.º 2
0
    def do_worklist_execute(msg, obj):
        """
        obj = MsgWorklist
        only dispatch msg, no work
        """
        ret = None
        
        # check
        if (not isinstance(obj, MsgWorklist)):
            log.app_err("obj is not MsgWorklist")
            msg_rsp = msg + 2  # fail
            return (ERR_FATAL, msg_rsp)            

        try:
            # base on sn(thread)
            desc = "CPE(SN=%s) start process to execute worklist(%s)." %(
                    obj.sn, obj.worklist_name)
            log.app_info(desc) 
            
            thread1 = CpeThread(msg, obj)
            thread1.start()
            
            ret = ERR_SUCCESS 
            msg_rsp = msg + 1  # response(async)
        except Exception,e:
            # sn is busy
            ret = ERR_FAIL
            msg_rsp = msg + 2  # fail
            
            obj.dict_ret["str_result"] = str(e)
            log.app_info(e)               
Ejemplo n.º 3
0
def bind_no_rpc_cu(cpe, user_name, user_id):
    """
    in thread
    """

    ret = ERR_FAIL

    # nwf 2013-06-28
    desc = "system defined username(%s), userid(%s)" % (user_name, user_id)
    log.app_info(desc)

    for nwf in [1]:

        node_name = "InternetGatewayDevice.X_CU_UserInfo.Status"
        ret = bind_set_status(cpe, 0, node_name)  # 0=success
        if (ret != ERR_SUCCESS):
            break

        node_name = "InternetGatewayDevice.X_CU_UserInfo.Result"
        ret = bind_set_result(cpe, 0, node_name)  # start
        if (ret != ERR_SUCCESS):
            break

        # nwf 2013-07-01
        ret = bind_set_result(cpe, 1, node_name)  # finish

    return ret
Ejemplo n.º 4
0
def update_username_password_to_acs(sn,
                                    Username="",
                                    Password="",
                                    ConnectionRequestUsername="",
                                    ConnectionRequestPassword=""):
    """
    obj = MsgWorklistExecute
    worklist修改了认证密码 需要通知到ACS,否则后续的RPC认证会失败
    """

    d1 = {}
    if Username:
        d1["acs_auth_cpe_username"] = Username
    if Password:
        d1["acs_auth_cpe_password"] = Password
    if ConnectionRequestUsername:
        d1["cpe_auth_acs_username"] = ConnectionRequestUsername
    if ConnectionRequestPassword:
        d1["cpe_auth_acs_password"] = ConnectionRequestPassword

    info = u"修改的用户名 密码信息=%s" % d1
    log.app_info(info)

    ret, ret_data = update_cpe_info(sn, d1)

    return ret, ret_data
Ejemplo n.º 5
0
def start_monitor_worklist(cpe, obj_monitor):
    """
    obj_alarm is MsgMonitorInform
    """

    ret = ERR_FAIL
    err_message = ""

    sn = cpe.get_sn()

    for nwf in [1]:

        # physic worklist ---------------
        dict_data = {
            "parameterlist": obj_monitor.parameterlist,
            "timelist": obj_monitor.timelist
        }
        obj = MsgWorklistBuild("Inform_Monitor_Monitor_Start", dict_data)
        obj_database = EventCode.auto_build_bind_physic_worklist(cpe, obj)

        save_id2worklistid(obj_monitor.id_, obj_database.id_)

        try:
            ret, err_message = EventCode.tx_worklist_exec(obj_database)
            ret = EventCode.rx_worklist_exec(ret, err_message)
            if (ret == ERR_SUCCESS):

                ret, err_message = EventCode.wait_worklist_exec_finish(
                    obj_database)
                if ret == ERR_SUCCESS:

                    desc = "start_monitor_worklist(id=%s) success." % (
                        obj_database.id_)
                    log.app_info(desc)

                    obj_monitor.dict_ret["str_result"] = desc

                else:
                    # worklist(id=worklist_2014-07-08_11:48:15.781_82424709) status is not success(fail)
                    # nwf 2014-07-08; +worklist fail
                    obj_db = restore_acs_worklist(obj_database.id_)
                    err_message = err_message + "\n" + obj_db.dict_ret[
                        "str_result"]
                    log.app_err(err_message)

                    obj_monitor.dict_ret["str_result"] = err_message
                    break
            else:
                log.app_err(err_message)

                obj_monitor.dict_ret["str_result"] = err_message
                break

        except Exception, e:
            print_trace(e)

            obj_monitor.dict_ret["str_result"] = e
            break

        ret = ERR_SUCCESS
Ejemplo n.º 6
0
def bind_do_worklists(logic_worklists):
    """
    """

    ret = ERR_FAIL
    err_message = ""
    bool_logic_worklist = True  # default success
    status_result = 1

    # logic worklist ---------------
    for obj_database in logic_worklists:

        try:

            desc = "begin to exec worklist---name:%s  time_bind:%s" % (
                obj_database.worklist_name, obj_database.time_bind)
            log.app_info(desc)

            ret, err_message = EventCode.tx_worklist_exec(obj_database)
            ret = EventCode.rx_worklist_exec(ret, err_message)
            if (ret == ERR_SUCCESS):
                ret, err_message = EventCode.wait_worklist_exec_finish(
                    obj_database)
                if (ret != ERR_SUCCESS):
                    log.app_err(err_message)
                    bool_logic_worklist = False
            else:
                log.app_err(err_message)
                bool_logic_worklist = False
                # continue, not break

        except Exception, e:
            print_trace(e)
            bool_logic_worklist = False
Ejemplo n.º 7
0
def test_script(obj):
    """
    obj = MsgWorklistExecute
    default function name= test_script    
    """
    ret_worklist = ERR_FAIL  # default
    ret_rpc = ERR_FAIL
    ret_datas = ""
    sn = obj.sn

    for nwf in [1]:
        try:
            u1 = User(sn,
                      ip=worklistcfg.AGENT_HTTP_IP,
                      port=worklistcfg.AGENT_HTTP_PORT,
                      page=worklistcfg.WORKLIST2AGENT_PAGE,
                      sender=KEY_SENDER_WORKLIST,
                      worklist_id=obj.id_)
            log.app_info("Auto process get rpc methods")
            ret_rpc, ret_data = u1.get_rpc_methods()

            if ret_rpc == ERR_SUCCESS:
                ret_datas = ret_datas + "\n" + str(ret_data)
                log.app_info("success:%s" % ret_data)
            else:
                log.app_err("fail:%s" % ret_data)
                break

            ret_worklist = ERR_SUCCESS
            obj.dict_ret["str_result"] = ret_datas

        except Exception, e:
            log.app_err(e)
            break
Ejemplo n.º 8
0
    def connectionLost(self, reason):
        ip = self.transport.client[0]
        port = self.transport.client[1]    
        sessionno = self.transport.sessionno 

        desc = "connection lost(ip=%s, port=%s, sessionno=%s)" %(ip, port, sessionno)
        log.app_info(desc)
Ejemplo n.º 9
0
def auto_exec_worklist(worklist, cpe):
    """
    """
    ret = ERR_FAIL
    err_message = ""

    sn = cpe.get_sn()
    for nwf in [1]:

        # physic worklist ---------------
        obj = MsgWorklistBuild(worklist, {})
        obj_database = EventCode.auto_build_bind_physic_worklist(cpe, obj)
        try:
            ret, err_message = EventCode.tx_worklist_exec(obj_database)
            ret = EventCode.rx_worklist_exec(ret, err_message)
            if (ret == ERR_SUCCESS):

                ret, err_message = EventCode.wait_worklist_exec_finish(
                    obj_database)
                if ret == ERR_SUCCESS:
                    desc = "worklist(%s) execute success." % worklist
                    log.app_info(desc)
                else:
                    log.app_err(err_message)
                    break
            else:
                desc = "worklist(%s) execute fail." % worklist
                log.app_err(desc)
                break
        except Exception, e:
            print_trace(e)
            break

        ret = ERR_SUCCESS
Ejemplo n.º 10
0
def on_check_cpe_online(interval):
    """
    """
    from cpe import CPE

    ret = None

    on_check = partial(on_check_cpe_online, interval)
    t = Timer(interval, on_check)
    t.start()
    AcsCpeThread.set_timer_check_cpes_online(t)  # save

    log.app_info("~~~~~~~~~~%s~~~~~~~~~~" % (interval))

    #copy
    for sn, cpe in CPE.m_dict_sn2cpe.items():

        t1 = cpe.cpe_property.get_onlinetime()

        if (datetime.now() - t1 >= timedelta(seconds=interval)):

            d = threads.deferToThread(process_cpe_online_geturl, cpe)
            d.addCallback(process_cpe_online_callback, cpe)

            cpe.cpe_thread.set_thread_check_online(d)  # save
Ejemplo n.º 11
0
 def set_user_event(self, user_event):
     old = self.get_user_event()
     if (user_event != old):
         self.user_event = user_event
         log.app_info("cpe(sn=%s), user event update(%s->%s)" %
                      (self.cpe.get_sn(), get_event_desc(old),
                       get_event_desc(user_event)))
Ejemplo n.º 12
0
    def wait_eventcode_stop(self, obj):
        """
        """
        obj_database = obj

        for nwf in [1]:

            # 1 query exist?
            id_ = obj.id_
            obj_database = restore_acs_wait_eventcode(id_)
            if (obj_database is None):
                desc = "id(%s) is not exist." % id_
                log.app_err(desc)

                break

            # log
            desc = "id = %s" % (id_)
            log.app_info(desc)

            # MySQL
            time1 = datetime.now()
            update_acs_monitor_rules(obj_database, "STATUS",
                                     MONITOR_INFORM_STATUS_STOP_SUCCESS)
            update_acs_monitor_rules(obj_database, "TIME_STOP", str(time1))

        return ERR_SUCCESS, obj_database
Ejemplo n.º 13
0
    def get_monitor_parameter(self, obj):
        """
        obj is MsgAlarmInform
        """
        ret = ERR_FAIL
        obj_database = obj

        for nwf in [1]:

            # 1 query exist?
            id_ = obj.id_
            obj_database = restore_acs_inform_monitor(id_)
            if (obj_database is None):
                desc = "id(%s) is not exist." % id_
                log.app_err(desc)

                break

            # log
            desc = "id = %s" % (id_)
            log.app_info(desc)

            ret, ret_informs, ret_times = \
                self.search_informs_by_eventcodes_and_time(obj_database)
            if (ret == ERR_SUCCESS):
                self.get_informs_values(ret_informs, ret_times, obj_database)

        return ret, obj_database
Ejemplo n.º 14
0
    def get_alarm_parameter(self, obj):
        """
        obj is MsgAlarmInform
        """
        ret = ERR_FAIL
        obj_database = obj

        for nwf in [1]:

            # 1 query exist?
            id_ = obj.id_
            obj_database = restore_acs_inform_alarm(id_)
            if (obj_database is None):
                desc = "id(%s) is not exist." % id_
                log.app_err(desc)

                break

            # log
            desc = "id = %s" % (id_)
            log.app_info(desc)

            cpe = self.cpe
            if (cpe.cpe_property.get_cpe_operator() == "CU"):
                ret = self.get_alarm_parameter_4cu(obj_database)
            else:
                ret, ret_informs, ret_times = \
                    self.search_informs_by_eventcodes_and_time(obj_database)
                if (ret == ERR_SUCCESS):
                    self.get_informs_values(ret_informs, ret_times,
                                            obj_database)

        return ret, obj_database
Ejemplo n.º 15
0
def handle_dispath_request(request):
    """
    处理所有消息入口
    """
    try:
        msg = request.content.read()
        conn = request

        if msg:
            try:
                log.app_info(
                    "(Request from client %s)agent httserver recv message.\n" %
                    ResponseClientHandle.get_client_ipaddress(conn))
                """
                log.debug_info("-------httserver handle_dispath_request----------")
                log.debug_info(msg)
                log.debug_info("-------------------------------------------------")
                """
                msg = eval(msg)
            except Exception, e:
                err_info = "The structure of recv message is invalid!"
                log.debug_err(err_info)
                return

        responseclient.g_http_client_count += 1
        log.app_info(
            "acceptConnection: Agent HTTP connected client count: %d" %
            responseclient.g_http_client_count)

        t = threading.Thread(target=root_dispath_evetn, args=(msg, conn))
        t.setDaemon(True)
        t.start()
Ejemplo n.º 16
0
    def send_msg(request, msg_rsp, obj):
        """
        echo sender
        """
        ret             = ERR_FAIL  
        str_dict_msg    = ""
        

        ip = request.transport.client[0]
        port = request.transport.client[1]

        desc = "send %s(ip=%s, port=%s)" %(get_event_desc(msg_rsp), ip, port)
        log.app_info(desc)
        try:
            strio = StringIO()
            pickle.dump(obj, strio)  

            try:
                dict1  = Worklist.get_user_dictmsg(request)
                seq = dict1.get(KEY_SEQUENCE)
            except Exception,e:
                print_trace(e) 
                dict1  = {}

            dict1[KEY_MESSAGE]      = msg_rsp
            dict1[KEY_OBJECT]       = strio.getvalue()                  
            dict1[KEY_SENDER]       = KEY_SENDER_WORKLIST  

            str_dict_msg = str(dict1)
            
            Worklist.request_write(request, str_dict_msg)
            UsersMsgSeq.save_user_rsp_msg(seq, str_dict_msg) 
            
            ret = ERR_SUCCESS           
Ejemplo n.º 17
0
    def handle_worklist(self, msg, obj):
        """
        obj = MsgWorklistExecute
        """        
        ret = None
        ret_api     = ERR_FAIL
        ret_data    = ""
        ret_obj     = None  # event obj
        ret_out     = ""    # RF ret 
        file_imp    = None
        module_imp  = None

        sn = obj.sn
        desc = "cpe(sn=%s) begin execute worklist(name=%s)" %(
                sn, obj.worklist_name)
        log.app_info(desc)

        for nwf in [1]:
            try:

                # nwf 2014-06-28; DB lost interface_version
                if (not obj.cpe_interface_version):
                    ret_api, ret_data = user.query_cpe_interface_version(sn)
                    if ret_api == ERR_SUCCESS:
                        ret_obj = ret_data
                        ret_out = ret_obj.dict_ret["str_result"]                    
                        obj.cpe_interface_version = ret_out
                    else:
                        desc = "query CPE interface version fail."
                        obj.dict_ret["str_result"] = desc
                        break
                    
                ret = self.check_dir_file(obj)
                if (ret != ERR_SUCCESS):
                    break                                

                # nwf 2014-06-27;  use full path, not sys.path[0] + module name
                name_imp = self.exec_script_modulename
                file_imp, imppath, description = imp.find_module(name_imp, 
                                                                [self.exec_script_dir])
                module_imp =imp.load_module(name_imp, file_imp, imppath, description)                                
                entry = worklistcfg.DOMAIN_SCRIPT_FILE_ENTRY                          
                # entry (eg test_script(obj)
                x = "ret= %s.%s(obj)" %("module_imp", entry) 

                desc = "cpe(sn=%s) execute worklist(name=%s)" %(obj.sn, obj.worklist_name)
                log.app_info(desc)
        
                exec x
                
            except Exception,e:
                print_trace(e)            
                ret = ERR_FAIL
                obj.dict_ret["str_result"] = str(e)                    
                break              
            finally:
Ejemplo n.º 18
0
    def dispatch_agent(request):    
        """
        request = twisted.web.server.Request user
        """  
        ret         = ERR_FAIL  # default
        ret_api     = None


        for nwf in [1]:

            # dict in?
            try:
                body = request.content.read()
                dict1 = eval(body)
            except Exception,e:
                log.app_err("request content read, isn't a dict(%s)." %(e))
                break

            # save
            Worklist.set_user_dictmsg(request, dict1)            

            # have message ?
            v_msg = dict1.get(KEY_MESSAGE)
            if (not v_msg):
                log.app_err("dict KEY_MESSAGE missing(%s)." %(KEY_MESSAGE))
                break    
                
            ip = request.transport.client[0]
            port = request.transport.client[1]
            log.app_info("receive user(ip=%s, port=%s) message=%s" %(ip, port, get_event_desc(v_msg))) 

            # have message sequence ?
            v_seq = dict1.get(KEY_SEQUENCE)
            if (not v_seq):
                log.app_err("dict KEY_SEQUENCE missing(%s)." %(KEY_SEQUENCE))
                break  

            sender = dict1.get(KEY_SENDER, "")
            log.app_info("receive user(ip=%s, port=%s) sender=%s, sequence=%s" %(ip, port, sender, v_seq))
            ret_api,msg = UsersMsgSeq.is_user_message_seq_exist(v_seq)
            if (ret_api):   
                log.app_err("receive user(ip=%s, port=%s) sequence=%s is exist." %(ip, port, v_seq))                
                Worklist.process_user_message_seq_exist(request, msg)
                break  

            # have obj?   
            v_obj = dict1.get(KEY_OBJECT)
            if (not v_obj):
                log.app_err("dict KEY_OBJECT missing(%s)." %(KEY_OBJECT))
                break
            try:
                strio = StringIO(v_obj)  
                obj = pickle.load(strio)
            except Exception,e:
                log.app_err("dict KEY_OBJECT pick load fail.")
                break                
Ejemplo n.º 19
0
def stop_alarm_worklist(cpe, obj_alarm):
    """
    obj_alarm is MsgAlarmInform
    """

    ret = ERR_FAIL
    err_message = ""

    sn = cpe.get_sn()

    for nwf in [1]:

        # physic worklist ---------------
        start_worklist_id = get_id2worklistid(obj_alarm.id_)
        pop_id2worklistid(obj_alarm.id_)

        node_add_object = get_worklist_node_add_object(start_worklist_id)
        if (not node_add_object):
            desc = "node_add_object is None."
            log.app_err(desc)
        pop_worklist_node_add_object(obj_alarm.id_)

        dict_data = {"node_add_object": node_add_object}

        obj = MsgWorklistBuild("Inform_Monitor_Alarm_Stop", dict_data)
        obj_database = EventCode.auto_build_bind_physic_worklist(cpe, obj)

        try:
            ret, err_message = EventCode.tx_worklist_exec(obj_database)
            ret = EventCode.rx_worklist_exec(ret, err_message)
            if (ret == ERR_SUCCESS):

                ret, err_message = EventCode.wait_worklist_exec_finish(
                    obj_database)
                if ret == ERR_SUCCESS:
                    desc = "stop_alarm_worklist success."
                    log.app_info(desc)

                    obj_alarm.dict_ret["str_result"] = desc
                else:
                    log.app_err(err_message)

                    obj_alarm.dict_ret["str_result"] = err_message
                    break
            else:
                log.app_err(err_message)

                obj_alarm.dict_ret["str_result"] = err_message
                break
        except Exception, e:
            print_trace(e)

            obj_alarm.dict_ret["str_result"] = e
            break

        ret = ERR_SUCCESS
Ejemplo n.º 20
0
 def set_acs2cpe_loginname(self, acs2cpe_loginname):
     old = self.get_acs2cpe_loginname()
     if (acs2cpe_loginname != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.acs2cpe_loginname = acs2cpe_loginname
         log.app_info("cpe([%s]sn=%s), acs loginname update(%s->%s)" %
                      (cpe_id, sn, old, acs2cpe_loginname))
         # mysql
         update_acs_cpe_new(cpe_id, "ACS2CPE_NAME", acs2cpe_loginname)
Ejemplo n.º 21
0
 def set_cwmpversion(self, cwmp_version):
     old = self.get_cwmpversion()
     if (old != cwmp_version):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.cwmp_version = cwmp_version
         log.app_info("cpe([%s]sn=%s), cwmp version update(%s->%s)" %
                      (cpe_id, sn, old, cwmp_version))
         # mysql
         update_acs_cpe_new(cpe_id, "CWMP_VERSION", cwmp_version)
Ejemplo n.º 22
0
 def set_acs2cpe_url(self, acs2cpe_url):
     old = self.get_acs2cpe_url()
     if (acs2cpe_url != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.acs2cpe_url = acs2cpe_url
         log.app_info("cpe([%s]sn=%s), acs2cpe_url update(%s->%s)" %
                      (cpe_id, sn, old, acs2cpe_url))
         # mysql
         update_acs_cpe_new(cpe_id, "CONN_RQST_URL", acs2cpe_url)
Ejemplo n.º 23
0
 def set_cpe_interface_version(self, interface_version):
     old = self.get_cpe_interface_version()
     if (interface_version != old):
         sn = self.cpe.get_sn()
         self.cpe_interface_version = interface_version
         log.app_info("cpe(sn=%s),cpe interface_version update(%s->%s)" %
                      (sn, old, interface_version))
         # mysql
         cpe_id = self.cpe.get_cpe_id()
         update_acs_cpe_new(cpe_id, "INTERFACE_VERSION", interface_version)
Ejemplo n.º 24
0
 def set_cpe_worklist_rollback(self, cpe_worklist_rollback):
     old = self.get_cpe_worklist_rollback()
     if (cpe_worklist_rollback != old):
         self.cpe_worklist_rollback = cpe_worklist_rollback
         log.app_info("cpe(sn=%s), cpe worklist_rollback update(%s->%s)" %
                      (self.cpe.get_sn(), old, cpe_worklist_rollback))
         # mysql
         cpe_id = self.cpe.get_cpe_id()
         update_acs_cpe_new(cpe_id, "CPE_WORKLIST_ROLLBACK",
                            cpe_worklist_rollback)
Ejemplo n.º 25
0
 def set_cpe_domain(self, cpe_domain):
     old = self.get_cpe_domain()
     if (cpe_domain != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.cpe_domain = cpe_domain
         log.app_info("cpe([%s]sn=%s),cpe domain update(%s->%s)" %
                      (cpe_id, sn, old, cpe_domain))
         # mysql
         update_acs_cpe_new(cpe_id, "CPE_DEVICE_TYPE", cpe_domain)
Ejemplo n.º 26
0
 def set_cpe2acs_loginname(self, cpe2acs_loginname):
     old = self.get_cpe2acs_loginname()
     if (cpe2acs_loginname != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.cpe2acs_loginname = cpe2acs_loginname
         log.app_info("cpe([%s]sn=%s), cpe2acs loginname update(%s->%s)" %
                      (cpe_id, sn, old, cpe2acs_loginname))
         # mysql
         update_acs_cpe_new(cpe_id, "CPE2ACS_NAME", cpe2acs_loginname)
Ejemplo n.º 27
0
 def set_cpe_authtype(self, cpe_authtype):
     old = self.get_cpe_authtype()
     if (cpe_authtype != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.cpe_authtype = cpe_authtype
         log.app_info("cpe([%s]sn=%s),cpe authtype update(%s->%s)" %
                      (cpe_id, sn, old, cpe_authtype))
         # mysql
         update_acs_cpe_new(cpe_id, "AUTH_TYPE", cpe_authtype)
Ejemplo n.º 28
0
 def set_cpe_operator(self, cpe_operator):
     old = self.get_cpe_operator()
     if (cpe_operator != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.cpe_operator = cpe_operator
         log.app_info("cpe([%s]sn=%s),cpe operator update(%s->%s)" %
                      (cpe_id, sn, old, cpe_operator))
         # mysql
         update_acs_cpe_new(cpe_id, "CPE_OPERATOR", cpe_operator)
Ejemplo n.º 29
0
 def set_cpe2acs_loginpassword(self, cpe2acs_loginpassword):
     old = self.get_cpe2acs_loginpassword()
     if (cpe2acs_loginpassword != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.cpe2acs_loginpassword = cpe2acs_loginpassword
         log.app_info("cpe([%s]sn=%s), cpe loginpassword update(%s->%s)" %
                      (cpe_id, sn, old, cpe2acs_loginpassword))
         # mysql
         update_acs_cpe_new(cpe_id, "CPE2ACS_PASSWORD",
                            cpe2acs_loginpassword)
Ejemplo n.º 30
0
 def set_acs2cpe_loginpassword(self, acs2cpe_loginpassword):
     old = self.get_acs2cpe_loginpassword()
     if (acs2cpe_loginpassword != old):
         sn = self.cpe.get_sn()
         cpe_id = self.cpe.get_cpe_id()
         self.acs2cpe_loginpassword = acs2cpe_loginpassword
         log.app_info("cpe([%s]sn=%s), acs loginpassword update(%s->%s)" %
                      (cpe_id, sn, old, acs2cpe_loginpassword))
         # mysql
         update_acs_cpe_new(cpe_id, "ACS2CPE_PASSWORD",
                            acs2cpe_loginpassword)