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()
评论列表
文章目录