我尝试使用lib cloud连接Vcloud,使用firefox的restapi进行身份验证很好,但是在python中失败了。我错过什么了吗?在
__author__ = 'kshk'
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security
def testConnection():
#libcloud.security.VERIFY_SSL_CERT = False
vcloud = get_driver(Provider.VCLOUD)
driver = vcloud("login", "passwd", host = "https://portal.vcloud")
nodes = driver.list_nodes()
print nodes
def main():
testConnection()
if __name__ == "__main__":
main()
输出:
^{pr2}$
您的代码不起作用,因为“host”参数只需要主机名而不是url。在
如果将其更改为:
它应该有用。在
相关问题 更多 >
编程相关推荐