deployMatch.py 文件源码

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

项目:astoptool 作者: zouliuyun 项目源码 文件源码
def add_base_hosts_for_ssh(self):
        with lcd('/app/opbin/krb_hosts'):
            result = local('''grep -nE '[0-9]{1,3}(\.[0-9]{1,3}){3} +%s_match_%s' base_hosts''' % (GAME, self.id - 1))
            lines = result.splitlines()
            if len(lines) == 1:
                rowNum, line = lines[0].split(':', 1) #???????
                run('cp base_hosts bak/base_hosts.rb{}'.format(TIME))
                run("sed -i '{}a {} {}' base_hosts".format(rowNum, self.ip, self.matchServer))
            else:
                print('[WARNING] Failed to add_base_hosts_for_ssh, can NOT locate a proper postion to add the new match entry, because there are more than one entry for {}_match_{}'.format(GAME, self.id - 1))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号