container.py 文件源码

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

项目:kuberdock-platform 作者: cloudlinux 项目源码 文件源码
def _set_delayed(self):
        """Delayed change of iptables rules (postprocess method).
        After deleting/creation of pod we should change iptables rules, but
        we don't know if the operation actually have been performed. So, wait
        for 2 minutes and call postprocess method as superuser (via suid
        binary 'suidwrap').

        """
        token = getattr(self, 'token', None)
        if not token or token == 'None':
            data = self.query.get(AUTH_TOKEN_PATH)
            token = data['token']
        try:
            fmt = 'echo /usr/libexec/suidwrap "{0}" {1} ' \
                  '|at now + 2 minute > /dev/null 2>&1'
            subprocess.check_call([fmt.format(token, quote(self.name))],
                                  shell=True)
        except (KeyError, TypeError, subprocess.CalledProcessError):
            return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号