本文整理汇总了Python中status.Status.getStatusArray方法的典型用法代码示例。如果您正苦于以下问题:Python Status.getStatusArray方法的具体用法?Python Status.getStatusArray怎么用?Python Status.getStatusArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类status.Status
的用法示例。
在下文中一共展示了Status.getStatusArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __getState
# 需要导入模块: from status import Status [as 别名]
# 或者: from status.Status import getStatusArray [as 别名]
def __getState(self, ip, framework ):
if ip is None:
return 0, "not deployed by OpenStack"
state = None
try:
# timeout of 0.1 seconds needed as without it, this call would be stuck;
# maybe less would be enough, but it always depends on the network connection
response = urllib2.urlopen(Request('http://'+ip+':8084/status.log'), None, 0.1)
state = int(response.read())
except:
pass
if state is None:
return 0, "waiting for framework deployment on cluster"
statusArray = Status.getStatusArray(framework)
if len(statusArray) <= state:
return -1, "there is no state like this"
return state, statusArray[ state ]