PPP.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:hologram-python 作者: hologram-io 项目源码 文件源码
def __check_for_existing_ppp_sessions(self):

        existing_ppp_pids = []
        self.logger.info('Checking for existing PPP sessions')

        for proc in psutil.process_iter():

            try:
                pinfo = proc.as_dict(attrs=['pid', 'name'])
            except:
                raise PPPError('Failed to check for existing PPP sessions')

            if 'pppd' in pinfo['name']:
                self.logger.info('Found existing PPP session on pid: %s', pinfo['pid'])
                existing_ppp_pids.append(pinfo['pid'])

        return existing_ppp_pids
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号