• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python g_logger.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中umit.icm.agent.logger.g_logger.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get_tests

 def get_tests(self,current_version):
     """
     """
     g_logger.info("[DesktopAgentSession]  Send Test Sets message to %s" % self.remote_ip)
     request_msg = NewTests()
     request_msg.currentTestVersionNo = int(current_version)  #Get current version from DB
     self._send_message(request_msg)        
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:desktop.py


示例2: update_test_mod

def update_test_mod(result, *args, **kw):
    g_logger.info("Updating Test Module...")
    # args = ((version, check_code=0), {})
    version = args[0]
    if len(args) == 2:
        check_code = args[1]
    else:
        check_code = 0

    filename = 'test_' + version + '.py'
    path = os.path.join(TMP_DIR, filename)
    if not os.path.exists(path):
        g_logger.error("Test mod %s can't be found under '/tmp' folder." %
                       filename)
        return

    if check_code != 0:
        # Verify if the file is the correct one
        content = open(filename, 'rb').read()
        crc = zlib.crc32(content) & 0xffffffff
        if crc != check_code:
            g_logger.error("Test mod %s is corrupt. Try to download it again." %
                           filename)
            return

    # Rename the original test.py to test.py.bak,
    # and replace test.py with new one
    origin = os.path.join(ROOT_DIR, 'umit', 'icm', 'agent', 'test.py')
    shutil.copy(origin, origin + '.bak')
    shutil.copy(path, origin)
    if 'umit.icm.agent.test' in sys.modules:
        reload(sys.modules['umit.icm.agent.test'])
    g_logger.info("Test Module updated.")
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:33,代码来源:Upgrade.py


示例3: _normal_peer_connected

    def _normal_peer_connected(self, peer_id, ip, port, ciphered_public_key=None,
                              network_id=0):
        if self.agent_is_banned(peer_id) or self.network_is_banned(ip):
            g_logger.info("Desktop agent %s is banned or is running from "
                          "a banned network %s" % (peer_id, ip))
            if peer_id in self.normal_peers:
                self.remove_normal_peer(peer_id)
            return False

        if peer_id in self.normal_peers and \
           self.normal_peers[peer_id].status == 'Connected':
            g_logger.warning("Peer %s already connected." % peer_id)
            return False

        if peer_id in self.normal_peers:
            g_logger.debug("Peer id %s already exists in normal peer list." %
                           peer_id)
            self.normal_peers[peer_id].status = 'Connected'
        else:
            peer_entry = PeerEntry()
            peer_entry.Type = 2
            peer_entry.ID = peer_id
            peer_entry.IP = ip
            peer_entry.Port = port
            peer_entry.CipheredPublicKey = ciphered_public_key
            peer_entry.status = 'Connected'
            peer_entry.network_id = network_id
            self.normal_peers[peer_entry.ID] = peer_entry

        self.connected_peer_num = self.connected_peer_num + 1
        
        return True
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:32,代码来源:PeerManager.py


示例4: set_super_peer_manual

 def set_super_peer_manual(self, ip, port, description=""):
     """
     add super peer information into super_peer_manual table
     """
     sql_str = "insert or replace into super_peers_manual values " "('%s', '%s', '%s')" % (ip, port, description)
     g_logger.info("[save_to_db]:save %s into DB" % sql_str)
     self.execute(sql_str)
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:db.py


示例5: _handle_check_aggregator_website_err

 def _handle_check_aggregator_website_err(self,failure):
     """
     """
     g_logger.info("Cannot connect Aggregator website: %s" % self.base_url)
     self.available = False
     
     return self.available
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:aggregator.py


示例6: _send_message

 def _send_message(self, message, transport):
     g_logger.info("Sending a %s message to %s" % (message.DESCRIPTOR.name,
                                                   transport.getPeer()))
     data = MessageFactory.encode(message)
     length = struct.pack('!I', len(data))
     transport.write(length)
     transport.write(data)
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:mobile.py


示例7: sync_bannets

 def sync_bannets(self, message):
     for network in message.networks:
         ban = g_db_helper.insert_banned_network(network.start_ip,
                                                 network.end_ip,
                                                 network.nodes_count,
                                                 network.flags)
         g_logger.info("Banned %s: %s" % (network, str(ban)))
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:PeerManager.py


示例8: connect_to_peer

    def connect_to_peer(self, peer_id):
        if self.agent_is_banned(peer_id):
            g_logger.info("Agent %s is banned." % peer_id)

        if peer_id == theApp.peer_info.ID:
            g_logger.error("Can't connect to self.")
        if peer_id not in self.sessions:
            peer_entry = None
            if peer_id in self.super_peers:
                peer_entry = self.super_peers[peer_id]
            elif peer_id in self.normal_peers:
                peer_entry = self.normal_peers[peer_id]
            elif peer_id in self.mobile_peers:
                peer_entry = self.mobile_peers[peer_id]
            else:
                g_logger.error("Peer id '%s' doesn't exist in all peer lists." %
                               peer_id)
                return

            if self.network_is_banned(peer_entry.IP):
                g_logger.info("Agent %s is banned in network grounds (%s)." % \
                                 (peer_id, peer_entry.IP))
                return

            reactor.connectTCP(peer_entry.IP, peer_entry.Port,
                               theApp.factory)
            g_logger.debug("Connecting to %s:%d..." %
                           (peer_entry.IP, peer_entry.Port))
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:28,代码来源:PeerManager.py


示例9: add_mobile_peer

    def add_mobile_peer(self, peer_id, ip, port, ciphered_public_key=None,
                        status='Disconnected', network_id=0):
        if self.agent_is_banned(peer_id) or self.network_is_banned(ip):
            g_logger.info("Mobile agent %s is banned or is running from a banned "
                          "network %s" % (peer_id, ip))

            if peer_id in self.mobile_peers:
                self.remove_mobile_peer(peer_id)

            return

        if peer_id in self.mobile_peers:
            g_logger.info("Peer id %s already exists in mobile peer list." %
                          peer_id)
        else:
            peer_entry = PeerEntry()
            peer_entry.Type = 3
            peer_entry.ID = peer_id
            peer_entry.IP = ip
            peer_entry.Port = port
            peer_entry.CipheredPublicKey = ciphered_public_key
            peer_entry.status = status
            peer_entry.network_id = network_id
            self.mobile_peers[peer_entry.ID] = peer_entry
            self.mobile_peer_num = self.mobile_peer_num + 1
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:25,代码来源:PeerManager.py


示例10: add_normal_peer

    def add_normal_peer(self, peer_id, ip, port, token =None ,ciphered_public_key=None,
                        status='Disconnected', network_id=0):
        """
        """
        #if self.agent_is_banned(peer_id) or self.network_is_banned(ip):
        #    g_logger.info("Desktop agent %d is banned or is running from a banned "
        #                  "network %s" % (peer_id, ip))
        #    
        #    if peer_id in self.normal_peers:
        #        self.remove_normal_peer(peer_id)
        #
        #    return

        if peer_id in self.normal_peers:
            g_logger.info("Peer id %s already exists in normal peer list." %
                          peer_id)
        else:
            peer_entry = PeerEntry()
            peer_entry.Type = 2
            peer_entry.ID = peer_id
            peer_entry.IP = ip
            peer_entry.Port = port
            peer_entry.Token = token
            peer_entry.CipheredPublicKey = ciphered_public_key
            peer_entry.status = status
            peer_entry.network_id = network_id
            self.normal_peers[peer_entry.ID] = peer_entry
            self.normal_peer_num = self.normal_peer_num + 1       
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:28,代码来源:PeerManager.py


示例11: irc_NICK

 def irc_NICK(self,prefix,params):
     """
     called when an IRC user changes their nickname
     """
     old_nick = prefix.split('!')[0]
     new_nick = params[0]
     g_logger.info("[ServiceTest:IRC]%s is now known as %s:" % (old_nick,new_nick))  
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:7,代码来源:test.py


示例12: handle_message

 def handle_message(self, message):
     if isinstance(message, P2PGetSuperPeerList):
         self._handle_get_super_peer_list(message)
     elif isinstance(message, P2PGetSuperPeerListResponse):
         self._handle_get_super_peer_list_response(message)
     elif isinstance(message, P2PGetPeerList):
         self._handle_get_peer_list(message)
     elif isinstance(message, P2PGetPeerListResponse):
         self._handle_get_peer_list_response(message)
     elif isinstance(message, SendWebsiteReport):
         self._handle_send_website_report(message)
     elif isinstance(message, SendServiceReport):
         self._handle_send_service_report(message)
     elif isinstance(message, SendReportResponse):
         self._handle_send_report_response(message)
     elif isinstance(message,NewVersionResponse):
         self._hanlde_new_version_response(message)         
     elif isinstance(message, AgentUpdateResponse):
         g_logger.info("Peer %s update agent to version %s: %S" %
                       (self.remote_id, message.version, message.result))
     elif isinstance(message, TestModuleUpdateResponse):
         g_logger.info("Peer %s update test mod to version %s: %S" %
                       (self.remote_id, message.version, message.result))
     elif isinstance(message, NewTestsResponse):
         self._handle_get_tests_response(message)
     elif isinstance(message,NewTests):
         self._handle_get_tests(message)
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:27,代码来源:desktop.py


示例13: _linux_clear

 def _linux_clear(self):
     file = self.auto_sys_path + self.desktop_name
     if os.path.exists(file):
         try:
             os.remove(file)
             g_logger.info("Cancel Auto StartUP icm-agent in Linux (%s)" % (file))
         except Exception, e:
             g_logger.error("[Failed] Cancel Auto StartUP icm-agent in Linux  (%s)" % (file))
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:8,代码来源:Startup.py


示例14: save_to_db

 def save_to_db(self):
     if self.is_registered:
         sql_str = "insert or replace into peer_info values " \
                         "('%s', '%s', '%s', '%s', '%s', %d)" % \
                         (self.ID, self.Username, self.Password, self.Email,
                          self.CipheredPublicKeyHash, self.Type)
         g_logger.info("[save_to_db]:save %s into DB"%sql_str)            
         g_db_helper.execute(sql_str)
         g_db_helper.commit()
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:9,代码来源:PeerInfo.py


示例15: send_service_report

 def send_service_report(self, report):
     g_logger.info("Send %s message to %s" % (report.DESCRIPTOR.name,
                                              self.remote_ip))
     request_msg = SendServiceReport()
     #request_msg.header.token = theApp.peer_info.AuthToken
     #request_msg.header.agentID = str(theApp.peer_info.ID)
     request_msg.report.CopyFrom(report)
     self._send_message(request_msg)
     self.pending_report_ids.append(report.header.reportID)
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:9,代码来源:desktop.py


示例16: execute

    def execute(self):
        """Run the test"""
        g_logger.info("Testing website: %s" % self.url)

        defer_ = self._agent.request("GET", self.url, Headers({"User-Agent": ["ICM Website Test"]}), None)
        self.time_start = default_timer()
        defer_.addCallback(self._handle_response)
        defer_.addErrback(self._connectionFailed)
        return defer_
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:9,代码来源:test.py


示例17: verifyHostKey

 def verifyHostKey(self,host_key,fingerprint=""):
     g_logger.info("host key fingerprint %s" % fingerprint)  
     #we cannot provide the key, so we should check the failure to decide the result
     if self.reportDeferred:
         task_done(self.__class__.__name__, TEST_SERVICE_TYPE, self.test)
         result = {'status_code': 0, 'time_end': default_timer()}
         self.reportDeferred.callback(result)     
     self.loseConnection()
     return defer.succeed(1)
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:9,代码来源:test.py


示例18: show_details

    def show_details(self, task_type):
        """
        """
        self.task_list_dict = {}
        cnt = 0

        from umit.icm.agent.gui.dashboard.DashboardListBase import TASK_ALL, TASK_SUCCESSED, TASK_FAILED

        #########################
        # Get Task Details From DB
        rs = g_db_helper.get_task_sets(task_type=task_type)

        if rs == None:
            g_logger.info("Cannot load any Tasks from DB.")
            self.treeview.set_sensitive(True)
            self.store.clear()
            self.treeview.set_model(self.store)  # It must be after the store update
            return

        for record in rs:
            self.task_list_dict[cnt] = {}
            self.task_list_dict[cnt]["sequence"] = record[0]
            self.task_list_dict[cnt]["test_id"] = record[1]
            self.task_list_dict[cnt]["website_url"] = record[2]
            self.task_list_dict[cnt]["test_type"] = record[3]
            self.task_list_dict[cnt]["service_name"] = record[4]
            self.task_list_dict[cnt]["service_ip"] = record[5]
            self.task_list_dict[cnt]["service_port"] = record[6]
            self.task_list_dict[cnt]["done_status"] = record[7]
            self.task_list_dict[cnt]["done_result"] = record[8]
            self.task_list_dict[cnt]["execute_time"] = record[9]
            cnt += 1

        g_logger.info("Loaded %d tasks from DB." % len(rs))

        #####################
        # Output in the Window
        self.treeview.set_sensitive(True)
        self.store.clear()

        for line in self.task_list_dict.keys():
            self.store.append(
                [
                    self.task_list_dict[line]["sequence"],
                    self.task_list_dict[line]["test_id"],
                    self.task_list_dict[line]["website_url"],
                    self.task_list_dict[line]["test_type"],
                    self.task_list_dict[line]["service_name"],
                    self.task_list_dict[line]["service_ip"],
                    self.task_list_dict[line]["service_port"],
                    self.task_list_dict[line]["done_status"],
                    self.task_list_dict[line]["done_result"],
                    self.task_list_dict[line]["execute_time"],
                ]
            )

        self.treeview.set_model(self.store)  # It must be after the store update
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:57,代码来源:TaskTab.py


示例19: _handle_check_tests_response

 def _handle_check_tests_response(self, message):
     if message is None:
         return
     
     #print message.tests
     #print message.testVersionNo
     
     g_logger.info("Receive Test Sets!")     
     return message
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:9,代码来源:aggregator.py


示例20: _handle_get_bannets_response

    def _handle_get_bannets_response(self, message):
        g_logger.info("GET BANNETS RESPONSE: %s" % message)
        if message is None:
            return

        # TODO: Store the bannets locally
        theApp.peer_manager.sync_bannets(message)

        return message
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:9,代码来源:aggregator.py



注:本文中的umit.icm.agent.logger.g_logger.info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python i18n._函数代码示例发布时间:2022-05-27
下一篇:
Python g_logger.debug函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap