def setUp(self):
     VCloudNodeDriver.connectionCls.host = 'test'
     VCloudNodeDriver.connectionCls.conn_classes = (None,
                                                    VCloud_1_5_MockHttp)
     VCloud_1_5_MockHttp.type = None
     self.driver = VCloud_1_5_NodeDriver(*VCLOUD_PARAMS,
                                         **{'api_version': '5.1'})
    def __init__(self, platforminfo, username, key, secret=None):
        self.platformNo =  platforminfo["platformNo"]
        self.username = username
        self.logger.info(u"利用プラットフォーム" + str(self.platformNo))


        #接続情報
        vCloudInfo = getVCloudInfo(self.platformNo)
        host = vCloudInfo["host"]
        secure = vCloudInfo["secure"]
        pltfmNotimeout = vCloudInfo["timeout"]
        self.vdc_name = vCloudInfo["vdc"]
        self.defnet = vCloudInfo["defnetwork"]

        #アクセスキー生成
        key = key + "@" + vCloudInfo["org"]

        #タイムアウト
        if pltfmNotimeout is not None:
            #コネクションタイムアウト
            self.connectionCls.timeout = int(pltfmNotimeout)
            #タスク待ちタイムアウト
            self.timeout = int(pltfmNotimeout)

        #プロキシ利用
        useProxy = platforminfo["proxy"]
        if useProxy == 1:
            useProxy = True
        else:
            useProxy = False
        self.connectionCls.useProxy = useProxy

        #プロトコル
        if secure == 1:
            secure = True
        else:
            secure = False

        self.logger.info(u"接続情報==> "+host+": secure=" + str(secure))

        VCloud_1_5_NodeDriver.__init__(self, key=key, secret=secret, secure=secure, host= host)
Exemplo n.º 3
0
 def setUp(self):
     VCloudNodeDriver.connectionCls.host = 'test'
     VCloudNodeDriver.connectionCls.conn_class = VCloud_1_5_MockHttp
     VCloud_1_5_MockHttp.type = None
     self.driver = VCloud_1_5_NodeDriver(*VCLOUD_PARAMS)