本文整理汇总了Python中nailgun.network.manager.NetworkManager.get_keystone_url方法的典型用法代码示例。如果您正苦于以下问题:Python NetworkManager.get_keystone_url方法的具体用法?Python NetworkManager.get_keystone_url怎么用?Python NetworkManager.get_keystone_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.network.manager.NetworkManager
的用法示例。
在下文中一共展示了NetworkManager.get_keystone_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GET
# 需要导入模块: from nailgun.network.manager import NetworkManager [as 别名]
# 或者: from nailgun.network.manager.NetworkManager import get_keystone_url [as 别名]
def GET(self, cluster_id):
try:
cluster = db().query(Cluster).get(cluster_id)
cluster_attrs = self.get_cluster_attrs(cluster)
network_manager = NetworkManager()
horizon_url = network_manager.get_horizon_url(cluster_id)
keystone_url = network_manager.get_keystone_url(cluster_id)
return {
"horizon_url": horizon_url,
"keystone_url": keystone_url,
"admin_username": cluster_attrs["user"],
"admin_password": cluster_attrs["password"],
"admin_tenant_name": cluster_attrs["tenant"],
"controller_nodes_ips": self.get_controller_nodes_ips(cluster),
"controller_nodes_names": self.get_controller_nodes_fqdns(cluster),
}
except Exception as exc:
logger.error(traceback.format_exc())
raise web.badrequest(message=str(exc))