cloud_app.py 文件源码

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

项目:starwatts-boto 作者: defab-sw 项目源码 文件源码
def __init__(self, connection, application, version, environment, project, instance_type='m1.xlarge', user='root',
                 instance=None, ami=None, debug=False):
        if debug:
            logging.basicConfig(level=logging.DEBUG)

        # API attributes
        self.connection = connection

        # AMI and VM attributes
        self.application = application
        self.version = version
        self.environment = environment
        self.project = project
        self.user = user
        self.instance_type = instance_type
        self.ami = ami
        if instance is not None:
            self.instance_name = instance.tags.get('name')
        else:
            self.instance_name = "node_{}_{}".format(self.application, self.project)
        self.instance = instance

        # SSH connection and command attributes
        self.connected = False
        self.errors = list()
        self.ssh_sock = None
        self.ssh_client = paramiko.SSHClient()
        self.ssh_client.load_system_host_keys()
        self.ssh_client._policy = paramiko.WarningPolicy()
        self.ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号