gcs.py 文件源码

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

项目:cloud-deploy-grid 作者: elodina 项目源码 文件源码
def __init__(self, grid_name, credentials, **kwargs):
        self.grid_name = grid_name
        self.credentials = urllib.unquote(credentials)
        self.current_grid = GridEntity.select().where(
            GridEntity.name == grid_name).get()
        self.current_config = configs[
            self.current_grid.provider].select().where(
            configs[self.current_grid.provider].parentgrid ==
            self.current_grid).get()
        self.private_key_text = urllib.unquote(self.current_config.sshkeydata)
        self.private_key = RSA.importKey(self.private_key_text.strip())
        self.public_key_text = self.private_key.publickey().exportKey('OpenSSH')
        self.current_groups = []
        if not os.path.exists('result/{}/infrastructure'.format(grid_name)):
            os.makedirs('result/{}/infrastructure'.format(grid_name))
        for group in groups[self.current_grid.provider].select():
            if group.parentgrid.name == grid_name:
                self.current_groups.append(group)
        self.config = AutoDict()
        self.networking = AutoDict()
        self.security = AutoDict()
        self.terminal = AutoDict()
        self.masters = AutoDict()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号