vultr.py 文件源码

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

项目:nanobox-adapter-libcloud 作者: nanobox-io 项目源码 文件源码
def __init__(self, **kwargs):
        self.generic_credentials = {
            'key': os.getenv('VULTR_API_KEY', '')
        }

        for host in [request.host, os.getenv('APP_NAME', '') + '.nanoapp.io']:
            try:
                ip = socket.gethostbyname(host) or None
            except socket.gaierror:
                ip = None

            if ip:
                break

        self.auth_instructions += (' (If you need to be more specific about '
            'the access controls, you can use %s/32, but keep in mind that '
            'this address may change at any point in the future, and you will '
            'need to update your Vultr account accordingly to continue '
            'deploying.)') % (ip) if ip else ''

    # Internal overrides for provider retrieval
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号