示例#1
0
    def __init__(self, platforminfo, username, key, secret=None):
        self.platformNo = platforminfo["platformNo"]
        self.username = username
        self.logger.info(u"利用プラットフォーム" + str(self.platformNo))

        #接続情報
        cloudstackInfo = getCloudStackInfo(self.platformNo)
        host = cloudstackInfo["host"]
        path = cloudstackInfo["path"]
        port = cloudstackInfo["port"]
        secure = cloudstackInfo["secure"]
        pltfmNotimeout = cloudstackInfo["timeout"]
        self.devicetype = cloudstackInfo["device"]
        self.hostid = cloudstackInfo["hostid"]

        #タイムアウト
        if pltfmNotimeout is not None:
            self.connectionCls.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 + ":" + port + path + " secure=" +
                         str(secure))

        CloudStackNodeDriver.__init__(self,
                                      key=key,
                                      secret=secret,
                                      secure=secure,
                                      host=host,
                                      path=path,
                                      port=port)
    def __init__(self, platforminfo, username, key, secret=None):
        self.platformNo =  platforminfo["platformNo"]
        self.username = username
        self.logger.info(u"利用プラットフォーム" + str(self.platformNo))

        #接続情報
        cloudstackInfo = getCloudStackInfo(self.platformNo)
        host = cloudstackInfo["host"]
        path = cloudstackInfo["path"]
        port = cloudstackInfo["port"]
        secure = cloudstackInfo["secure"]
        pltfmNotimeout = cloudstackInfo["timeout"]
        self.devicetype =  cloudstackInfo["device"]
        self.hostid = cloudstackInfo["hostid"]

        #タイムアウト
        if pltfmNotimeout is not None:
            self.connectionCls.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+":" + port + path + " secure=" + str(secure))

        CloudStackNodeDriver.__init__(self, key=key, secret=secret, secure=secure,
                                      host= host, path=path, port=port)