tickets.py 文件源码

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

项目:treadmill 作者: Morgan-Stanley 项目源码 文件源码
def write(self, path=None):
        """Writes the ticket to /var/spool/ticket/<princ>."""
        def _write_temp(tkt_file):
            # Write the file
            tkt_file.write(self.ticket)
            # Set the owner
            if self.uid is not None:
                os.fchown(tkt_file.fileno(), self.uid, -1)
            # TODO: Should we enforce the mode too?
            tkt_file.flush()

        if path is None:
            path = self.tkt_path
        try:
            fs.write_safe(
                path,
                _write_temp,
                prefix='.tmp' + self.princ
            )
        except (IOError, OSError):
            _LOGGER.exception('Error writing ticket file: %s', path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号